Changeset 12728 in josm for trunk/src


Ignore:
Timestamp:
2017-09-05T01:22:57+02:00 (2 years ago)
Author:
Don-vip
Message:

see #13036 - fix more unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r12718 r12728  
    6161    private final transient LinkedList<Command> cmds = new LinkedList<>();
    6262    private int cmdsCount;
     63    private DataSet ds;
    6364    private final transient List<Relation> addedRelations = new LinkedList<>();
    6465
     
    538539            // retrieve effective dataset before joining the ways (which affects the selection, thus, the <ways> collection)
    539540            // Dataset retrieving allows to call this code without relying on Main.getCurrentDataSet(), thus, on a mapview instance
    540             DataSet ds = ways.iterator().next().getDataSet();
     541            ds = ways.iterator().next().getDataSet();
    541542
    542543            // Do the job of joining areas
     
    15391540
    15401541        Relation newRel;
     1542        RelationRole soleOuter;
    15411543        switch (multiouters.size()) {
    15421544        case 0:
     
    15441546        case 1:
    15451547            // Found only one to be part of a multipolygon relation, so just add it back as well
    1546             newRel = new Relation(multiouters.get(0).rel);
    1547             newRel.addMember(new RelationMember(multiouters.get(0).role, outer));
    1548             cmds.add(new ChangeCommand(multiouters.get(0).rel, newRel));
     1548            soleOuter = multiouters.get(0);
     1549            newRel = new Relation(soleOuter.rel);
     1550            newRel.addMember(new RelationMember(soleOuter.role, outer));
     1551            cmds.add(new ChangeCommand(ds, soleOuter.rel, newRel));
    15491552            return;
    15501553        default:
     
    15661569            }
    15671570            newRel.addMember(new RelationMember("outer", outer));
    1568             cmds.add(new AddCommand(outer.getDataSet(), newRel));
     1571            cmds.add(new AddCommand(ds, newRel));
    15691572        }
    15701573    }
Note: See TracChangeset for help on using the changeset viewer.