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

issues with String.toLowerCase/toUpperCase

    Details

    • Subcomponent:
    • Resolved In Build:
      b151
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Description

      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 JCE source code.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                xuelei Xue-Lei Fan
                Reporter:
                xuelei Xue-Lei Fan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: