Changeset 7013 in josm for trunk


Ignore:
Timestamp:
2014-04-27T15:48:04+02:00 (6 years ago)
Author:
Don-vip
Message:

drop support of OSM API 0.5

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r7005 r7013  
    194194     * Sets the API version this dataset was created from.
    195195     *
    196      * @param version the API version, i.e. "0.5" or "0.6"
     196     * @param version the API version, i.e. "0.6"
    197197     */
    198198    public void setVersion(String version) {
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r7005 r7013  
    395395        }
    396396
    397         // copy the merged layer's API version, downgrade if required
     397        // copy the merged layer's API version
    398398        if (data.getVersion() == null) {
    399399            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");
    403400        }
    404401
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r7012 r7013  
    121121            throwException(tr("Missing mandatory attribute ''{0}''.", "version"));
    122122        }
    123         if (!("0.5".equals(v) || "0.6".equals(v))) {
     123        if (!"0.6".equals(v)) {
    124124            throwException(tr("Unsupported version: {0}", v));
    125125        }
     
    468468                }
    469469                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;
    479470            default:
    480471                // should not happen. API version has been checked before
     
    486477            if (!current.isNew() && ds.getVersion() != null && "0.6".equals(ds.getVersion())) {
    487478                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 primitives
    490                 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.5
    494                 version= 0;
    495479            }
    496480        }
Note: See TracChangeset for help on using the changeset viewer.