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

Collator gives wrong results when security manager is installed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • None
    • 9
    • core-libs
    • None
    • java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+111)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+111, mixed mode)

      Debian GNU/Linux 8.3

    • b111
    • 9
    • linux

    Description

      With JDK 9-ea b111 some of Apache Derby's regression tests started failing. The reason appears to be that java.util.Collator.getInstance(Locale) does not return the correct Collator when a security manager is installed.

      Given the following Java program:

      import java.text.Collator;
      import java.util.Locale;

      public class TestCollator {
          public static void main(String[] args) {
              Collator c = Collator.getInstance(new Locale("no"));
              System.out.println(c.compare("ab", "aa"));
          }
      }

      With JDK 8u72 and with JDK 9-ea b110, the program prints -1 both when a security manager is installed and when one is not installed. This is the expected result.

      With JDK 9-ea b111, however, I see the following behaviour:

      $ ./b111/jre-9/bin/java TestCollator
      -1
      $ ./b111/jre-9/bin/java -Djava.security.manager TestCollator
      1

      Both should have printed -1.

      Attachments

        Issue Links

          Activity

            People

              okutsu Masayoshi Okutsu
              khatlen Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: