Skip to content

Commit

Permalink
Allow redundant lines in data files to facilitate merging (#962)
Browse files Browse the repository at this point in the history
  • Loading branch information
eggrobin authored Nov 12, 2024
1 parent c5ad635 commit f32aee2
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 f32aee2

Please sign in to comment.