Changeset 2305 in josm for trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
- Timestamp:
- 2009-10-24T21:22:49+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r2300 r2305 36 36 abstract public class OsmPrimitive implements Comparable<OsmPrimitive>, Tagged { 37 37 38 static final AtomicLong idCounter = new AtomicLong(0); 38 private static final AtomicLong idCounter = new AtomicLong(0); 39 40 static long generateUniqueId() { 41 return idCounter.decrementAndGet(); 42 } 39 43 40 44 private static final int FLAG_MODIFIED = 1 << 0; … … 164 168 throw new IllegalArgumentException(tr("Expected ID >= 0. Got {0}.", id)); 165 169 else if (id == 0) { 166 this.id = idCounter.decrementAndGet();170 this.id = generateUniqueId(); 167 171 } else { 168 172 this.id = id; … … 400 404 */ 401 405 public void clearOsmId() { 402 this.id = idCounter.decrementAndGet();406 this.id = generateUniqueId(); 403 407 this.version = 0; 404 408 this.incomplete = false; … … 456 460 if(directionKeys == null) { 457 461 directionKeys = Main.pref.getCollection("tags.direction", 458 Arrays.asList( new String[]{"oneway","incline","incline_steep","aerialway"}));462 Arrays.asList("oneway","incline","incline_steep","aerialway")); 459 463 } 460 464 return directionKeys; … … 841 845 842 846 protected void saveCommonAttributes(PrimitiveData data) { 843 data.setId( data.getId());847 data.setId(id); 844 848 data.getKeys().clear(); 845 849 data.getKeys().putAll(getKeys());
Note:
See TracChangeset
for help on using the changeset viewer.