From e6577395cb9ac45405e808eca671d3a4c97e6cf4 Mon Sep 17 00:00:00 2001 From: Robin Leroy Date: Mon, 11 Nov 2024 19:37:13 +0100 Subject: [PATCH] Leniency --- .../src/main/java/org/unicode/props/PropertyUtilities.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java b/unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java index e2e9c1708..9b8019062 100644 --- a/unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java +++ b/unicodetools/src/main/java/org/unicode/props/PropertyUtilities.java @@ -31,6 +31,9 @@ public String merge(String first, String second) { static final > M putNew(M map, K key, V value) { final V oldValue = map.get(key); if (oldValue != null) { + if (oldValue.equals(value)) { + return map; + } throw new UnicodePropertyException( "Key already present in Map: " + key @@ -48,6 +51,9 @@ static final UnicodeMap putNew( final V oldValue = map.get(key); if (oldValue != null && (missingSet == null || !missingSet.contains(key))) { if (merger == null) { + if (oldValue.equals(value)) { + return map; + } throw new UnicodePropertyException( "Key already present in UnicodeMap: " + Utility.hex(key)