Skip to content

Commit 6a01bf7

Browse files
update with new test cases
1 parent c21de11 commit 6a01bf7

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/java.base/share/classes/java/lang/StringLatin1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private static int compareToFC0_UTF16(byte[] value, int off, int last, byte[] ot
275275
if (k1 < last || f1 != 0) {
276276
return 1;
277277
}
278-
if (k2 < olast || f1 != 0) {
278+
if (k2 < olast || f2 != 0) {
279279
return -1;
280280
}
281281
return 0;

src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public final class CaseFolding {
5050
*/
5151
public static boolean isDefined(int cp) {
5252
return getDefined(cp) != -1;
53-
}
53+
}
5454

5555
/**
5656
* Returns the case-folded form of the specified code point according
@@ -132,12 +132,11 @@ public final class CaseFolding {
132132
* additionalClosingCharacters.contains(Character.toUpperCase(ch))
133133
* }</pre>
134134
*
135-
* <p>
136-
* @spec https://www.unicode.org/reports/tr18/#Simple_Loose_Matches
137135
* @param start the starting code point of the character range
138136
* @param end the ending code point of the character range
139137
* @return a {@code int[]} containing the all simple case equivalents of characters in the range, excluding
140138
* those already in the range
139+
* @spec https://www.unicode.org/reports/tr18/#Simple_Loose_Matches
141140
*/
142141
public static int[] getClassRangeClosingCharacters(int start, int end) {
143142
int[] expanded = new int[expanded_case_cps.length];

test/jdk/java/lang/String/UnicodeCaseFoldingTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ static Stream<Arguments> caseFoldOrderingProvider() {
251251
Arguments.of("\u03C2", "\u03C3", 0), // ς vs σ
252252
Arguments.of("\uD835\uDD23", "R", 1), // 𝔯 (fraktur r) vs R
253253
Arguments.of("\uFF26", "E", 1), // F (full-width F) vs E
254-
Arguments.of("\u00C9clair", "Eclair", 1) // Éclair vs Eclair
254+
Arguments.of("\u00C9clair", "Eclair", 1), // Éclair vs Eclair
255+
Arguments.of("\u03bc\u00df", "\u00b5s", 1),
256+
Arguments.of("\u00b5s", "\u03bc\u00df", -1)
255257
);
256258
}
257259

0 commit comments

Comments
 (0)