Changeset 7013 in josm for trunk/src/org/openstreetmap/josm
- Timestamp:
- 2014-04-27T15:48:04+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r7005 r7013 194 194 * Sets the API version this dataset was created from. 195 195 * 196 * @param version the API version, i.e. "0. 5" or "0.6"196 * @param version the API version, i.e. "0.6" 197 197 */ 198 198 public void setVersion(String version) { -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r7005 r7013 395 395 } 396 396 397 // copy the merged layer's API version , downgrade if required397 // copy the merged layer's API version 398 398 if (data.getVersion() == null) { 399 399 data.setVersion(from.getVersion()); 400 } else if ("0.5".equals(data.getVersion()) ^ "0.5".equals(from.getVersion())) {401 Main.warn(tr("Mixing 0.6 and 0.5 data results in version 0.5"));402 data.setVersion("0.5");403 400 } 404 401 -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r7012 r7013 121 121 throwException(tr("Missing mandatory attribute ''{0}''.", "version")); 122 122 } 123 if (! ("0.5".equals(v) ||"0.6".equals(v))) {123 if (!"0.6".equals(v)) { 124 124 throwException(tr("Unsupported version: {0}", v)); 125 125 } … … 468 468 } 469 469 break; 470 case "0.5":471 if (version <= 0 && !current.isNew()) {472 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"));473 version = 1;474 } else if (version < 0 && current.isNew()) {475 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"));476 version = 0;477 }478 break;479 470 default: 480 471 // should not happen. API version has been checked before … … 486 477 if (!current.isNew() && ds.getVersion() != null && "0.6".equals(ds.getVersion())) { 487 478 throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.getUniqueId()))); 488 } else if (!current.isNew() && ds.getVersion() != null && "0.5".equals(ds.getVersion())) {489 // default version in 0.5 files for existing primitives490 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"));491 version= 1;492 } else if (current.isNew() && ds.getVersion() != null && "0.5".equals(ds.getVersion())) {493 // default version in 0.5 files for new primitives, no warning necessary. This is (was) legal in API 0.5494 version= 0;495 479 } 496 480 }
Note:
See TracChangeset
for help on using the changeset viewer.