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

issues with String.toLowerCase/toUpperCase

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 7
    • security-libs
    • None

      In JDK codes, there are many string comparisons that looks like:
         aString.toUpperCase().startsWith("anotherString")
         aString.toLowerCase().equals("anotherstring")
         aString.toLowerCase().contains("anotherstring")
         etc.

      The String.toLowerCase/toUpperCase() equals to String.toLowerCase/toUpperCase(Locale.getDefault()). According to CR 6208680 and the spec of String.toLowerCase/toUpperCase(), for some special region, for example Turkish and Azeri, the conversion maybe locale-sensitive. For example, for Turkish, the "i" is not mapped to "I" with String.toUpperCase(). When the default locale of JVM is set to the special region, the above string comparisons will not be able to work as expected.

      Please check the JGSS source code.

            weijun Weijun Wang
            xuelei Xuelei Fan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: