Ignore:
Timestamp:
2017-01-07T00:56:52+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #14199 - JOSM drops empty tags on loading and thus prevents correcting them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r10702 r11435  
    2525import org.openstreetmap.josm.data.DataSource;
    2626import org.openstreetmap.josm.data.coor.LatLon;
     27import org.openstreetmap.josm.data.osm.AbstractPrimitive;
    2728import org.openstreetmap.josm.data.osm.Changeset;
    2829import org.openstreetmap.josm.data.osm.DataSet;
     
    4142import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    4243import org.openstreetmap.josm.tools.CheckParameterUtil;
     44import org.openstreetmap.josm.tools.Utils;
    4345import org.openstreetmap.josm.tools.date.DateUtils;
    4446
     
    377379        if (key == null || value == null) {
    378380            throwException(tr("Missing key or value attribute in tag."));
     381        } else if (Utils.isStripEmpty(key) && t instanceof AbstractPrimitive) {
     382            // #14199: Empty keys as ignored by AbstractPrimitive#put, but it causes problems to fix existing data
     383            // Drop the tag on import, but flag the primitive as modified
     384            ((AbstractPrimitive) t).setModified(true);
    379385        } else {
    380386            t.put(key.intern(), value.intern());
Note: See TracChangeset for help on using the changeset viewer.