Changeset 8178 in josm
- Timestamp:
- 2015-04-09T19:55:39+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java
r7937 r8178 83 83 if(!e.getKey().equals(k)) { 84 84 if(drop || !keys.containsKey(k)) { 85 newKeys. remove(e.getKey());85 newKeys.put(e.getKey(), null); 86 86 if(!drop) 87 87 newKeys.put(k, v); 88 88 } 89 89 } else if(!e.getValue().equals(v)) { 90 if(v.isEmpty()) 91 newKeys.remove(k); 92 else 93 newKeys.put(k, v); 90 newKeys.put(k, v.isEmpty() ? null : v); 94 91 } else if (drop) { 95 newKeys. remove(e.getKey());92 newKeys.put(e.getKey(), null); 96 93 } 97 94 } … … 129 126 if(keys.containsKey(oldKey) && !keys.containsKey(newKey)) { 130 127 keys.put(newKey, keys.get(oldKey)); 131 keys.remove(oldKey); 128 keys.put(oldKey, null); 129 return true; 130 } else if(keys.containsKey(oldKey) && keys.containsKey(newKey) && keys.get(oldKey).equals(keys.get(newKey))) { 131 keys.put(oldKey, null); 132 132 return true; 133 133 } … … 169 169 keys.put(newKey, newValue); 170 170 if(!newKey.equals(oldKey)) 171 keys. remove(oldKey);171 keys.put(oldKey, null); 172 172 return true; 173 173 } … … 189 189 190 190 for (OsmPrimitive osm : objectsToUpload) { 191 Map<String, String> keys = osm.getKeys(); 191 HashMap<String, String> keys = new HashMap<>(osm.getKeys()); 192 192 if(!keys.isEmpty()) { 193 193 boolean modified = false; … … 197 197 } 198 198 if(modified) 199 cmds.add(new ChangePropertyCommand(Collections.singleton(osm), new HashMap<>(keys)));199 cmds.add(new ChangePropertyCommand(Collections.singleton(osm), keys)); 200 200 } 201 201 }
Note:
See TracChangeset
for help on using the changeset viewer.