diff --git a/src/share/classes/java/lang/ConditionalSpecialCasing.java b/src/share/classes/java/lang/ConditionalSpecialCasing.java index 9f3d81624e9ca0c2b3f50c1783702ec658c8ec0d..d2ed9d91b502400ab4b5b6b0ca95ea4a77724163 100644 --- a/src/share/classes/java/lang/ConditionalSpecialCasing.java +++ b/src/share/classes/java/lang/ConditionalSpecialCasing.java @@ -74,7 +74,6 @@ final class ConditionalSpecialCasing { new Entry(0x00CC, new char[]{0x0069, 0x0307, 0x0300}, new char[]{0x00CC}, "lt", 0), // # LATIN CAPITAL LETTER I WITH GRAVE new Entry(0x00CD, new char[]{0x0069, 0x0307, 0x0301}, new char[]{0x00CD}, "lt", 0), // # LATIN CAPITAL LETTER I WITH ACUTE new Entry(0x0128, new char[]{0x0069, 0x0307, 0x0303}, new char[]{0x0128}, "lt", 0), // # LATIN CAPITAL LETTER I WITH TILDE - new Entry(0x0130, new char[]{0x0069, 0x0307}, new char[]{0x0130}, "lt", 0), // # LATIN CAPITAL LETTER I WITH DOT ABOVE //# ================================================================================ //# Turkish and Azeri @@ -85,10 +84,7 @@ final class ConditionalSpecialCasing { new Entry(0x0049, new char[]{0x0131}, new char[]{0x0049}, "tr", NOT_BEFORE_DOT), // # LATIN CAPITAL LETTER I new Entry(0x0049, new char[]{0x0131}, new char[]{0x0049}, "az", NOT_BEFORE_DOT), // # LATIN CAPITAL LETTER I new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "tr", 0), // # LATIN SMALL LETTER I - new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "az", 0), // # LATIN SMALL LETTER I - //# ================================================================================ - //# Other - new Entry(0x0130, new char[]{0x0069, 0x0307}, new char[]{0x0130}, "en", 0), // # LATIN CAPITALLETTER I WITH DOT ABOVE + new Entry(0x0069, new char[]{0x0069}, new char[]{0x0130}, "az", 0) // # LATIN SMALL LETTER I }; // A hash table that contains the above entries diff --git a/src/share/classes/java/lang/String.java b/src/share/classes/java/lang/String.java index 2231aa3bb713dc05c8ac6a8ccf235d12896a295f..5c9a8017f140180253bcebb0a5f7862ab46ce3cc 100644 --- a/src/share/classes/java/lang/String.java +++ b/src/share/classes/java/lang/String.java @@ -2598,21 +2598,14 @@ public final class String } if (localeDependent || srcChar == '\u03A3') { // GREEK CAPITAL LETTER SIGMA lowerChar = ConditionalSpecialCasing.toLowerCaseEx(this, i, locale); - } else if (srcChar == '\u0130') { // LATIN CAPITAL LETTER I DOT - lowerChar = Character.ERROR; } else { lowerChar = Character.toLowerCase(srcChar); } if ((lowerChar == Character.ERROR) || (lowerChar >= Character.MIN_SUPPLEMENTARY_CODE_POINT)) { if (lowerChar == Character.ERROR) { - if (!localeDependent && srcChar == '\u0130') { - lowerCharArray = - ConditionalSpecialCasing.toLowerCaseCharArray(this, i, Locale.ENGLISH); - } else { - lowerCharArray = - ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale); - } + lowerCharArray = + ConditionalSpecialCasing.toLowerCaseCharArray(this, i, locale); } else if (srcCount == 2) { resultOffset += Character.toChars(lowerChar, result, i + resultOffset) - srcCount; continue; diff --git a/test/java/lang/String/ToLowerCase.java b/test/java/lang/String/ToLowerCase.java index 52fc11976c093b4c41de5fee13306f8050cbda5d..b1edb92dcc11345dc53b66da588118dbdc104fd4 100644 --- a/test/java/lang/String/ToLowerCase.java +++ b/test/java/lang/String/ToLowerCase.java @@ -23,7 +23,7 @@ /* @test - @bug 4217441 4533872 4900935 + @bug 4217441 4533872 4900935 8020037 @summary toLowerCase should lower-case Greek Sigma correctly depending on the context (final/non-final). Also it should handle Locale specific (lt, tr, and az) lowercasings and supplementary @@ -69,10 +69,11 @@ public class ToLowerCase { test("\u00CD", Locale.US, "\u00ED"); test("\u0128", Locale.US, "\u0129"); - // I-dot tests (Turkish and Azeri) + // I-dot tests test("\u0130", turkish, "i"); test("\u0130", az, "i"); - test("\u0130", Locale.US, "i\u0307"); + test("\u0130", lt, "i"); + test("\u0130", Locale.US, "i"); // Remove dot_above in the sequence I + dot_above (Turkish and Azeri) test("I\u0307", turkish, "i");