Skip to content

Commit

Permalink
Leniency
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin committed Nov 11, 2024
1 parent c5ad635 commit e657739
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public String merge(String first, String second) {
static final <K, V, M extends Map<K, V>> 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
Expand All @@ -48,6 +51,9 @@ static final <V> UnicodeMap<V> 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)
Expand Down

0 comments on commit e657739

Please sign in to comment.