Changeset 6936 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2014-03-28T19:53:24+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/NodeListViewer.java
r6883 r6936 276 276 277 277 public void updateEnabledState() { 278 setEnabled(primitiveId != null && primitiveId.getUniqueId() > 0);278 setEnabled(primitiveId != null && !primitiveId.isNew()); 279 279 } 280 280 } … … 314 314 if(row <= 0) return; 315 315 PrimitiveId pid = primitiveIdAtRow(table.getModel(), row); 316 if (pid == null )316 if (pid == null || pid.isNew()) 317 317 return; 318 318 showHistoryAction.setPrimitiveId(pid); -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r6650 r6936 448 448 } 449 449 if (ds.getVersion().equals("0.6")){ 450 if (version <= 0 && current.getUniqueId() > 0) {450 if (version <= 0 && !current.isNew()) { 451 451 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.getUniqueId()), versionString)); 452 } else if (version < 0 && current. getUniqueId() <= 0) {452 } else if (version < 0 && current.isNew()) { 453 453 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.6")); 454 454 version = 0; 455 455 } 456 456 } else if (ds.getVersion().equals("0.5")) { 457 if (version <= 0 && current.getUniqueId() > 0) {457 if (version <= 0 && !current.isNew()) { 458 458 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5")); 459 459 version = 1; 460 } else if (version < 0 && current. getUniqueId() <= 0) {460 } else if (version < 0 && current.isNew()) { 461 461 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 0, "0.5")); 462 462 version = 0; … … 469 469 // version expected for OSM primitives with an id assigned by the server (id > 0), since API 0.6 470 470 // 471 if ( current.getUniqueId() > 0&& ds.getVersion() != null && ds.getVersion().equals("0.6")) {471 if (!current.isNew() && ds.getVersion() != null && ds.getVersion().equals("0.6")) { 472 472 throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.getUniqueId()))); 473 } else if ( current.getUniqueId() > 0&& ds.getVersion() != null && ds.getVersion().equals("0.5")) {473 } else if (!current.isNew() && ds.getVersion() != null && ds.getVersion().equals("0.5")) { 474 474 // default version in 0.5 files for existing primitives 475 475 Main.warn(tr("Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.getUniqueId(), version, 1, "0.5")); 476 476 version= 1; 477 } else if (current. getUniqueId() <= 0&& ds.getVersion() != null && ds.getVersion().equals("0.5")) {477 } else if (current.isNew() && ds.getVersion() != null && ds.getVersion().equals("0.5")) { 478 478 // default version in 0.5 files for new primitives, no warning necessary. This is 479 479 // (was) legal in API 0.5 … … 500 500 current.setChangesetId(Integer.parseInt(v)); 501 501 } catch(NumberFormatException e) { 502 if (current. getUniqueId() <= 0) {502 if (current.isNew()) { 503 503 // for a new primitive we just log a warning 504 504 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId())); … … 510 510 } 511 511 if (current.getChangesetId() <=0) { 512 if (current. getUniqueId() <= 0) {512 if (current.isNew()) { 513 513 // for a new primitive we just log a warning 514 514 Main.info(tr("Illegal value for attribute ''changeset'' on new object {1}. Got {0}. Resetting to 0.", v, current.getUniqueId()));
Note:
See TracChangeset
for help on using the changeset viewer.