Changeset 18200 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2021-09-08T01:02:58+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21256 - RemoteControl: Don't add empty changeset tags to the dataset (patch by taylor.smock):

  • RemoteControl no longer adds "" to the dataset changesets (for changeset_ keys). Instead, it passes null to the map
  • DataSet#addChangesetTag now accepts a null value, which removes the key from the map
Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

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

    r18001 r18200  
    388388     */
    389389    public void addChangeSetTag(String k, String v) {
    390         this.changeSetTags.put(k, v);
     390        if (v != null) {
     391            this.changeSetTags.put(k, v);
     392        } else {
     393            this.changeSetTags.remove(k);
     394        }
    391395    }
    392396
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r18134 r18200  
    255255                    for (String tag : Arrays.asList("changeset_comment", "changeset_source", "changeset_hashtags")) {
    256256                        if (args.containsKey(tag)) {
    257                             ds.addChangeSetTag(tag.substring("changeset_".length()), args.get(tag));
     257                            final String tagKey = tag.substring("changeset_".length());
     258                            final String value = args.get(tag);
     259                            if (!Utils.isStripEmpty(value)) {
     260                                ds.addChangeSetTag(tagKey, value);
     261                            } else {
     262                                ds.addChangeSetTag(tagKey, null);
     263                            }
    258264                        }
    259265                    }
Note: See TracChangeset for help on using the changeset viewer.