From f11eb252dd98a1bac8090faa2f021a47f15a3d08 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Tue, 26 Mar 2024 16:42:09 +0100 Subject: [PATCH] Fix getSet on properties of strings when using incremental properties --- .../java/org/unicode/props/IndexUnicodeProperties.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unicodetools/src/main/java/org/unicode/props/IndexUnicodeProperties.java b/unicodetools/src/main/java/org/unicode/props/IndexUnicodeProperties.java index 5c101c7c4..1d16677ff 100644 --- a/unicodetools/src/main/java/org/unicode/props/IndexUnicodeProperties.java +++ b/unicodetools/src/main/java/org/unicode/props/IndexUnicodeProperties.java @@ -804,6 +804,14 @@ public UnicodeSet getSet(PatternMatcher matcher, UnicodeSet result) { System.out.println( "Long getSet for U" + ucdVersion + ":" + prop + " (" + Δt_in_ms + " ms)"); } + // We only do the delta thing for code points; for strings, we need to do the lookup + // directly (and clean whatever was added by walking through history). + if (baseVersionProperties != null + && (result.hasStrings() + || (_getRawUnicodeMap().stringKeys() != null + && !_getRawUnicodeMap().stringKeys().isEmpty()))) { + result.removeAllStrings().addAll(super.getSet(matcher, new UnicodeSet()).strings()); + } return result; }