Changeset 9216 in josm


Ignore:
Timestamp:
2015-12-29T21:29:58+01:00 (8 years ago)
Author:
stoecker
Message:

fix #12189 - properly handle the file version

File:
1 edited

Legend:

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

    r9206 r9216  
    112112
    113113    /**
     114     * Version of the loaded data file, required for updates
     115     */
     116    private int loadedVersion = 0;
     117
     118    /**
    114119     * Internal storage for the cache directory.
    115120     */
     
    16391644        while (true) {
    16401645            if (event == XMLStreamConstants.START_ELEMENT) {
     1646                try
     1647                {
     1648                  loadedVersion = Integer.parseInt(parser.getAttributeValue(null, "version"));
     1649                } catch (Exception e) {
     1650                }
    16411651                parseRoot();
    16421652            } else if (event == XMLStreamConstants.END_ELEMENT) {
     
    18781888        // update old style JOSM server links to use zip now, see #10581, #12189
    18791889        // actually also cache and mirror entries should be cleared
    1880         if (getInteger("josm.version", 0 /* current version avoids this value being written in #save() */) < 9206) {
     1890        if (loadedVersion < 9216) {
    18811891            for (String key: new String[]{"mappaint.style.entries", "taggingpreset.entries"}) {
    18821892                Collection<Map<String, String>> data = getListOfStructs(key, (Collection<Map<String, String>>) null);
Note: See TracChangeset for help on using the changeset viewer.