- Timestamp:
- 2022-11-29T08:29:55+01:00 (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/ChangesetDataSet.java
r16553 r18606 62 62 * @throws IllegalArgumentException if the same primitive was already stored with a higher or equal version 63 63 */ 64 public void put( HistoryOsmPrimitive primitive, ChangesetModificationType cmt) {64 public void put(final HistoryOsmPrimitive primitive, ChangesetModificationType cmt) { 65 65 CheckParameterUtil.ensureParameterNotNull(primitive, "primitive"); 66 66 CheckParameterUtil.ensureParameterNotNull(cmt, "cmt"); 67 67 DefaultChangesetDataSetEntry csEntry = new DefaultChangesetDataSetEntry(cmt, primitive); 68 Object val = entryMap.get(primitive.getPrimitiveId());68 final PrimitiveId pid = primitive.getPrimitiveId(); 69 69 ChangesetDataSetEntry[] entries; 70 if (val == null) {71 entryMap.put(primitive.getPrimitiveId(), csEntry);70 Object val = entryMap.computeIfAbsent(pid, k -> csEntry); 71 if (val == csEntry) 72 72 return; 73 }74 73 if (val instanceof ChangesetDataSetEntry) { 75 74 entries = new ChangesetDataSetEntry[2]; … … 78 77 throw new IllegalArgumentException( 79 78 tr("Changeset {0}: Unexpected order of versions for {1}: v{2} is not higher than v{3}", 80 String.valueOf(primitive.getChangesetId()), p rimitive.getPrimitiveId(),79 String.valueOf(primitive.getChangesetId()), pid, 81 80 primitive.getVersion(), entries[0].getPrimitive().getVersion())); 82 81 } … … 86 85 if (entries[1] != null) { 87 86 Logging.info("Changeset {0}: Change of {1} v{2} is replaced by version v{3}", 88 String.valueOf(primitive.getChangesetId()), p rimitive.getPrimitiveId(),87 String.valueOf(primitive.getChangesetId()), pid, 89 88 entries[1].getPrimitive().getVersion(), primitive.getVersion()); 90 89 } 91 90 entries[1] = csEntry; 92 entryMap.put(p rimitive.getPrimitiveId(), entries);91 entryMap.put(pid, entries); 93 92 } 94 93
Note:
See TracChangeset
for help on using the changeset viewer.