Skip to content

Commit f32aee2

Browse files
authored
Allow redundant lines in data files to facilitate merging (#962)
1 parent c5ad635 commit f32aee2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public String merge(String first, String second) {
3131
static final <K, V, M extends Map<K, V>> M putNew(M map, K key, V value) {
3232
final V oldValue = map.get(key);
3333
if (oldValue != null) {
34+
if (oldValue.equals(value)) {
35+
return map;
36+
}
3437
throw new UnicodePropertyException(
3538
"Key already present in Map: "
3639
+ key
@@ -48,6 +51,9 @@ static final <V> UnicodeMap<V> putNew(
4851
final V oldValue = map.get(key);
4952
if (oldValue != null && (missingSet == null || !missingSet.contains(key))) {
5053
if (merger == null) {
54+
if (oldValue.equals(value)) {
55+
return map;
56+
}
5157
throw new UnicodePropertyException(
5258
"Key already present in UnicodeMap: "
5359
+ Utility.hex(key)

0 commit comments

Comments
 (0)