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

getCollationKey throws exception for spanish text

XMLWordPrintable

    • x86
    • windows_95



      Name: clC74495 Date: 05/18/98


      Very simple example of exception creating a
      collation key for a spanish phrase. this worked
      in all previous jdk versions.

      try {
       // create spanish locale and collator
       Locale l = new Locale("es", "es");
       Collator col = Collator.getInstance(l);

       // this spanish phrase kills it!
       col.getCollationKey("Nombre De Objeto");
      } catch (Exception ex) {
       // stack trace shown below
       ex.printStackTrace();
      }


      java.lang.ArrayIndexOutOfBoundsException: 4 >= 4
      at java.lang.Throwable.<init>(Compiled Code)
      at java.util.Vector.elementAt(Compiled Code)
      at java.text.RuleBasedCollator.getContractValues(Compiled Code)
      at java.text.RuleBasedCollator.getContractValues(RuleBasedCollator.java:926)
      at java.text.CollationElementIterator.nextContractChar(Compiled Code)
      at java.text.CollationElementIterator.next(Compiled Code)
      at java.text.RuleBasedCollator.getCollationKey(Compiled Code)

      (Review ID: 29898)
      ======================================================================

            lwernersunw Laura Werner (Inactive)
            clucasius Carlos Lucasius (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: