Ignore:
Timestamp:
2017-10-03T21:31:04+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #15387 - IAE occurs when pasting tags into relation editor using "Paste tags from buffer" (regression from #13036)

Location:
trunk/src/org/openstreetmap/josm/gui/datatransfer/importers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/AbstractTagPaster.java

    r12641 r12920  
    1414import javax.swing.TransferHandler.TransferSupport;
    1515
     16import org.openstreetmap.josm.Main;
    1617import org.openstreetmap.josm.command.ChangePropertyCommand;
    1718import org.openstreetmap.josm.command.Command;
     
    4849    public boolean importTagsOn(TransferSupport support, Collection<? extends OsmPrimitive> selection)
    4950            throws UnsupportedFlavorException, IOException {
    50         ChangePropertyCommand command = new ChangePropertyCommand(selection, getTags(support));
     51        ChangePropertyCommand command = new ChangePropertyCommand(Main.main.getEditDataSet(), selection, getTags(support));
    5152        commitCommands(selection, Collections.singletonList(command));
    5253        return true;
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveTagTransferPaster.java

    r12769 r12920  
    88import java.util.Collection;
    99import java.util.EnumMap;
     10import java.util.HashMap;
    1011import java.util.List;
    1112import java.util.Map;
     
    5051        List<Command> commands = new ArrayList<>();
    5152        for (Tag tag : tagPaster.execute()) {
    52             ChangePropertyCommand cmd = new ChangePropertyCommand(selection, tag.getKey(), "".equals(tag.getValue()) ? null : tag.getValue());
     53            Map<String, String> tags = new HashMap<>(1);
     54            tags.put(tag.getKey(), "".equals(tag.getValue()) ? null : tag.getValue());
     55            ChangePropertyCommand cmd = new ChangePropertyCommand(Main.main.getEditDataSet(), selection, tags);
    5356            if (cmd.getObjectsNumber() > 0) {
    5457                commands.add(cmd);
Note: See TracChangeset for help on using the changeset viewer.