Ignore:
Timestamp:
2019-09-26T15:31:53+02:00 (5 years ago)
Author:
donvip
Message:

fix #josm17349 - IAE when not using associatedStreet relations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/actions/mapmode/Address.java

    r34458 r35132  
    1818import java.awt.event.WindowEvent;
    1919import java.util.ArrayList;
     20import java.util.Arrays;
    2021import java.util.Collection;
    2122import java.util.Collections;
     
    278279
    279280    private void addStreetNameOrRelation(OsmPrimitive osm, Collection<Command> cmds) {
     281        DataSet ds = OsmDataManager.getInstance().getEditDataSet();
    280282        if (Config.getPref().getBoolean("cadastrewms.addr.dontUseRelation", false)) {
    281             cmds.add(new ChangePropertyCommand(osm, tagHouseStreet, inputStreet.getText()));
     283            Map<String, String> tags = new HashMap<>();
     284            tags.put(tagHouseStreet, inputStreet.getText());
     285            cmds.add(new ChangePropertyCommand(ds, Arrays.asList(osm), tags));
    282286        } else if (selectedWay != null) {
    283287            Relation selectedRelation = findRelationAddr(selectedWay);
     
    295299                newRel.addMember(new RelationMember(relationAddrStreetRole, selectedWay));
    296300                newRel.addMember(new RelationMember(relationMemberHouse, osm));
    297                 cmds.add(new AddCommand(OsmDataManager.getInstance().getEditDataSet(), newRel));
     301                cmds.add(new AddCommand(ds, newRel));
    298302            }
    299303        }
Note: See TracChangeset for help on using the changeset viewer.