Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4096941

java.text.Collator.setStrength method doesn't accept Collator.IDENTICAL

XMLWordPrintable

    • sparc
    • solaris_2.5



      Name: avC70361 Date: 12/04/97



        The java.text.Collator.setStrength(int) method throws IllegalArgumentException
      when called with Collator.IDENTICAL as a parameter. But the JDK1.2 API
      documentation states that java.text.Collator.setStrength(int newStrength) throws
      IllegalArgumentException if the newStrength is not one of the PRIMARY,
      SECONDARY, TERTIARY or IDENTICAL.
       
      Here is the test demonstrating the bug:
      -----------CollatorTest.java---------
      import java.text.Collator;

      public class CollatorTest {

        public static void main(String args[]) {
          Collator collator = Collator.getInstance();
          collator.setStrength(Collator.IDENTICAL);
        }

      }
      ----------The test output------------
      #>java CollatorTest
      java.lang.IllegalArgumentException: Incorrect comparison level.
              at java.text.Collator.setStrength(Collator.java:355)
              at CollatorTest.main(CollatorTest.java:7)
      -------------------------------------
      ======================================================================

            joconnersunw John Oconner (Inactive)
            ovlasov Oleksandr Vlasov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: