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

java.text.RuleBasedCollator breaks on "< a < bb" rule

XMLWordPrintable

    • sparc
    • solaris_2.5



      Name: mgC56079 Date: 09/12/97



      Let the language consists of two characters: 'a' and 'bb' and collation rule
      is the following: "< a < bb", compare("a","bb") should return -1.
      It returns 1.

      ---------Here is the test demonstrating the bug (RBC.java) --------------

      import java.text.*;

      public class RBC {

      public static void main(String args[]) {

        try {
          RuleBasedCollator rbc=new RuleBasedCollator("< a < bb");
          System.out.println("Compare result (expect -1): "+rbc.compare("a","bb"));
        }
        catch (ParseException e) {
          System.out.println(e);
        }


      }

      }
      ---------Output from the test---------------------
      % java RBC
      Compare result (expect -1): 1

      --------------------------------------------------

      ======================================================================

            joconnersunw John Oconner (Inactive)
            mgorshen Mikhail Gorshenev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: