Changeset 8708 in josm for trunk/src/org


Ignore:
Timestamp:
2015-09-01T19:26:57+02:00 (5 years ago)
Author:
simon04
Message:

see #11827 - see #11653 - Revert r8566 till its impacts are fully clarified

Some/many parts of the code rely on org.openstreetmap.josm.data.osm.AbstractPrimitive#getKeys to be modifiable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java

    r8652 r8708  
    480480    @Override
    481481    public Map<String, String> getKeys() {
    482         final String[] keys = this.keys;
    483         if (keys == null || keys.length == 0) {
    484             return Collections.emptyMap();
    485         } else if (keys.length == 2) {
    486             return Collections.singletonMap(keys[0], keys[1]);
    487         }
    488 
    489         final Map<String, String> result = new HashMap<>(Utils.hashMapInitialCapacity(keys.length / 2));
    490         for (int i = 0; i < keys.length; i += 2) {
    491             result.put(keys[i], keys[i + 1]);
    492         }
    493 
     482        Map<String, String> result = new HashMap<>(Utils.hashMapInitialCapacity(keys.length / 2));
     483        String[] keys = this.keys;
     484        if (keys != null) {
     485            for (int i = 0; i < keys.length; i += 2) {
     486                result.put(keys[i], keys[i + 1]);
     487            }
     488        }
    494489        return result;
    495490    }
Note: See TracChangeset for help on using the changeset viewer.