Changeset 19124 in josm for trunk


Ignore:
Timestamp:
2024-06-22T16:12:54+02:00 (5 months ago)
Author:
GerdP
Message:

fix #23748: NPE: Reverse way direction: Automatic tag correction
(furter already expected regrression from r19101)

  • don't use Map.ofEntries() when map may contain null keys or values

I try to write a unit test for this as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r19121 r19124  
    666666            return Collections.singletonMap(entry.getKey(), entry.getValue());
    667667        }
    668         // Map.copyOf would also work, but if the original map is immutable, it just returns the original map.
    669         return Map.ofEntries(map.entrySet().toArray(new Map.Entry[0]));
     668        // see #23748 don't use Map.ofEntries as it doesn't allow null keys or values
     669        return Collections.unmodifiableMap(map);
    670670    }
    671671
Note: See TracChangeset for help on using the changeset viewer.