-
-
Notifications
You must be signed in to change notification settings - Fork 44
there can be only one UnicodeProperty.java #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
I tried at one point to pull UnicodeProperty out from CLDR, but it is
not simple. There are classes that depend on classes and so on, soit was
too hard to figure out what the tangled set of dependencies were, and where
I could cut the cord to allow me to extract a set of classes and tie off
the loose ends.
Mark
…On Sat, May 29, 2021 at 10:45 AM Markus Scherer ***@***.***> wrote:
Background: ucd-dev email thread “Unicode Tools vs. UnicodeProperty.java
<https://groups.google.com/g/ucd-dev/c/H60xj1kTfCU>”
We have two versions of org/unicode/cldr/util/props/UnicodeProperty.java,
one in CLDR and one in the Unicode Tools.
Until 1.5 years ago they were identical, but they have been diverging and
are now no longer even interface-compatible. The CLDR version is the newer
one.
For now, I am adding a note to the setup instructions to move cldr-code
above unicodetools in the build path, but of course that's evil and brittle.
We had agreed to move UnicodeProperty from CLDR into the Unicode Tools,
but other CLDR code depends on this class, and I am not sure if I have time
to get through that.
Maybe I just rename the unused Unicode Tools version at first.
There is also a third version of UnicodeProperty.java, in the UnicodeJsps
code, but thankfully it is in a different package. Still, this is confusing
and error-prone; we should either merge the classes or give them distinct
names.
-
https://github.com/unicode-org/cldr/blob/master/tools/cldr-code/src/main/java/org/unicode/cldr/util/props/UnicodeProperty.java
-
https://github.com/unicode-org/unicodetools/blob/main/unicodetools/org/unicode/cldr/util/props/UnicodeProperty.java
-
https://github.com/unicode-org/unicodetools/blob/main/UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeProperty.java
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#66>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJLEMDLXLVTZAO7LDBIWP3TQER4DANCNFSM45YP3R3A>
.
|
As @srl295 posted, I have performed a basic analysis of duplicated So I think the next step will be to look more closely into the overlaps and determine commonalities/differences inside and figure out what can be re-worked, removed, etc. |
this bit me trying to do #186 (IDNA)— because of the order of loading, ICU4J's UnicodeSet ends up calling into unicodetools' UnicodeProperty and crashes. |
Hmmm. We could rename unicodetools' version
…On Wed, Mar 23, 2022 at 11:55 AM Steven R. Loomis ***@***.***> wrote:
this bit me trying to do #186
<#186> (IDNA)— because
of the order of loading, ICU4J's UnicodeSet ends up calling into
unicodetools' UnicodeProperty and crashes.
—
Reply to this email directly, view it on GitHub
<#66 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJLEMBQ54LIJJAYF35ETIDVBNSIJANCNFSM45YP3R3A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@macchiati I'm going to try moving unicodetools' version into org.unicode.props … |
Back burner on this due to CLDR release, but just as an example of the layering problems: unicodetools/unicodetools/src/main/java/org/unicode/tools/TestSegments.java Lines 151 to 155 in 8d6bd2e
private static void doCompare(UnicodeProperty.Factory factory, Segmenter rl, String line) {
RandomStringGenerator rsg;
RuleBasedBreakIterator icuBreak;
if (line.equals("compareGrapheme")) {
rsg = new RandomStringGenerator(factory, "GraphemeClusterBreak"); So here we are calling into CLDR ( |
It looks like CLDR RandomStringGenerator has other problems, too. It sounds generic, but its init() function is specific to working with the GCB property. And when you call the (Factory, String, bool, bool) constructor, you get some data from the input factory and other data from the ICUPropertyFactory. If this is used from CLDR code, then I would clone it into Unicode Tools (with a different package and modified class name). If it's not used from CLDR code, then move it into Unicode Tools. It might also be possible to pull all of the factory calls out into the call site and construct this generator only with UnicodeSet/UnicodeMap/String/boolean values. |
- also move some code out of UnicodeJsps into org.unicode.jsp Relates to #66
…ackage - also move some code out of UnicodeJsps into org.unicode.jsp Relates to #66
- deprecate org.unicode.jsp.UnicodeProperty Relates to #66
- deprecate org.unicode.jsp.UnicodeProperty Relates to #66
Observations (not complaints):
|
I verified that the RandomStringGenerator is not used in CLDR. Please move it out of there and into the Unicode Tools. |
@markusicu my #214 does copy it into unicodetools paving the way for deletion on cldr. |
It's "now" illegal (as of JDK 9?) to have more than one module export the same package. So, CLDR and ICU aren't supposed to both export to |
Something I learned (and others might have realized some time ago): The Unicode Tools use the CLDR UnicodePropertySymbolTable which calls into UnicodeProperty. That must be a CLDR UnicodeProperty, which is what the symbol table code calls from within the CLDR jar. The Tools provide the symbol table with a ToolUnicodeProperty (which lives in the Tools) which extends UnicodeProperty. Bad things happen when CLDR code uses the Unicode Tools version of UnicodeProperty. Unicode Tools code needs the Unicode Tools version of UnicodeProperty. David changed CLDR UnicodeProperty to base its Matcher classes on a Java Predicate: The Unicode Tools version is still basing the Matchers on an older ObjectMatcher interface. |
FYI |
|
Background: ucd-dev email thread “Unicode Tools vs. UnicodeProperty.java”
We have two versions of org/unicode/cldr/util/props/UnicodeProperty.java, one in CLDR and one in the Unicode Tools.
Until 1.5 years ago they were identical, but they have been diverging and are now no longer even interface-compatible. The CLDR version is the newer one.
For now, I am adding a note to the setup instructions to move cldr-code above unicodetools in the build path, but of course that's evil and brittle.
We had agreed to move UnicodeProperty from CLDR into the Unicode Tools, but other CLDR code depends on this class, and I am not sure if I have time to get through that.
Maybe I just rename the unused Unicode Tools version at first.
There is also a third version of UnicodeProperty.java, in the UnicodeJsps code, but thankfully it is in a different package. Still, this is confusing and error-prone; we should either merge the classes or give them distinct names.
https://github.com/unicode-org/unicodetools/blob/main/UnicodeJsps/src/main/java/org/unicode/jsp/UnicodeProperty.javaRemoved in Remove the ancient and unused copy of UnicodeProperty #649, 2024-01-20.The text was updated successfully, but these errors were encountered: