Changeset 15783 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2020-01-26T23:49:41+01:00 (5 years ago)
Author:
Don-vip
Message:

see #18601 - Add synchronzation to ensure that the AbstractPrimitive current unique id is not incremented backwards accidentally (patch by taylor.smock)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/AbstractReader.java

    r14738 r15783  
    327327        } finally {
    328328            OptionalLong minId = externalIdMap.values().stream().mapToLong(AbstractPrimitive::getUniqueId).min();
    329             if (minId.isPresent() && minId.getAsLong() < AbstractPrimitive.currentUniqueId()) {
    330                 AbstractPrimitive.advanceUniqueId(minId.getAsLong());
     329            synchronized (AbstractPrimitive.class) {
     330                if (minId.isPresent() && minId.getAsLong() < AbstractPrimitive.currentUniqueId()) {
     331                    AbstractPrimitive.advanceUniqueId(minId.getAsLong());
     332                }
    331333            }
    332334            progressMonitor.finishTask();
Note: See TracChangeset for help on using the changeset viewer.