Skip to content

Commit

Permalink
ICU-21757 Bring in CollectionUtilities, depend only on icu4j (#810)
Browse files Browse the repository at this point in the history
* ICU-21757 Bring in CollectionUtilities, depend only on icu4j
* ICU-21757 Fix testGcbInDecompositions
* ICU-21757 TestCollectionUtilities logln, like the ICU original
* ICU-21757 Temp workaround version skew
  • Loading branch information
mihnita authored May 9, 2024
1 parent c4f1abb commit 3e8adc4
Show file tree
Hide file tree
Showing 11 changed files with 951 additions and 14 deletions.
2 changes: 1 addition & 1 deletion UnicodeJsps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!-- icu -->
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j-for-cldr</artifactId>
<artifactId>icu4j</artifactId>
</dependency>

<dependency>
Expand Down
3 changes: 1 addition & 2 deletions UnicodeJsps/src/main/java/org/unicode/jsp/Confusables.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.unicode.jsp;

import com.ibm.icu.dev.util.CollectionUtilities;
import com.ibm.icu.dev.util.UnicodeMap;
import com.ibm.icu.impl.Utility;
import com.ibm.icu.text.Normalizer;
Expand Down Expand Up @@ -41,7 +40,7 @@ public static UnicodeMap<String> getMap() {
UnicodeMap<String> result = new UnicodeMap<String>();
for (String s : equivalents) {
Set<String> others = new TreeSet<String>(equivalents.getEquivalences(s));
String list = "\u2051" + CollectionUtilities.join(others, "\u2051") + "\u2051";
String list = "\u2051" + String.join("\u2051", others) + "\u2051";
for (String other : others) {
result.put(other, list);
}
Expand Down
3 changes: 1 addition & 2 deletions UnicodeJsps/src/main/java/org/unicode/jsp/ScriptTester.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.unicode.jsp;

import com.ibm.icu.dev.util.CollectionUtilities;
import com.ibm.icu.dev.util.UnicodeMap;
import com.ibm.icu.lang.UCharacter;
import com.ibm.icu.lang.UProperty;
Expand Down Expand Up @@ -391,7 +390,7 @@ public static String getNames(
for (int i = value.nextSetBit(0); i >= 0; i = value.nextSetBit(i + 1)) {
names.add(ScriptTester.getScriptName(i, choice));
}
return CollectionUtilities.join(names, separator).toString();
return String.join(separator, names);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void TestCCC() {
XPropertyFactory factory = XPropertyFactory.make();
checkProperty(factory, "ccc");

String test = "[:ccc=/3/:]";
String test = "[:Udev:ccc=/3/:]";
UnicodeSet actual = UnicodeSetUtilities.parseUnicodeSet(test);
UnicodeSet expected = new UnicodeSet();
for (int i = 0; i < 256; ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.SortedMap;
import java.util.TreeSet;
import java.util.stream.Stream;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIf;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -375,6 +376,7 @@ public void TestGC() {
}

@Test
@Disabled("Stop using ICU for properties: version skew")
public void TestNF() {
for (String nf : new String[] {"d", "c", "kd", "kc"}) {
checkSetsEqual("[:isnf" + nf + ":]", "[:nf" + nf + "qc!=N:]");
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
For ICU versions, see https://github.com/orgs/unicode-org/packages?repo_name=icu
Note that we can't use the general ICU maven packages, because utilities isn't exported (yet).
-->
<icu.version>72.0.1-SNAPSHOT-cldr-2022-08-17</icu.version>
<icu.version>76.0.1-SNAPSHOT</icu.version>

<!--
For CLDR versions, see https://github.com/orgs/unicode-org/packages?repo_name=cldr
Expand Down Expand Up @@ -68,7 +68,7 @@
<!-- icu -->
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j-for-cldr</artifactId>
<artifactId>icu4j</artifactId>
<version>${icu.version}</version>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion unicodetools-testutils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependencies>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j-for-cldr</artifactId>
<artifactId>icu4j</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
Expand Down
2 changes: 1 addition & 1 deletion unicodetools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependencies>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j-for-cldr</artifactId>
<artifactId>icu4j</artifactId>
</dependency>

<dependency>
Expand Down
Loading

0 comments on commit 3e8adc4

Please sign in to comment.