Changeset 12063 in josm


Ignore:
Timestamp:
2017-05-05T16:15:49+02:00 (7 years ago)
Author:
michael2402
Message:

MoveAction: Fix ds.beginUpdate()/endUpdate() try/finally

File:
1 edited

Legend:

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

    r12053 r12063  
    137137
    138138        ds.beginUpdate();
    139         if (c instanceof MoveCommand && ds.equals(c.getAffectedDataSet())
    140                 && affectedNodes.equals(((MoveCommand) c).getParticipatingPrimitives())) {
    141             ((MoveCommand) c).moveAgain(distx, disty);
    142         } else {
    143             c = new MoveCommand(selection, distx, disty);
    144             Main.main.undoRedo.add(c);
     139        try {
     140            if (c instanceof MoveCommand && ds.equals(c.getAffectedDataSet())
     141                    && affectedNodes.equals(((MoveCommand) c).getParticipatingPrimitives())) {
     142                ((MoveCommand) c).moveAgain(distx, disty);
     143            } else {
     144                c = new MoveCommand(selection, distx, disty);
     145                Main.main.undoRedo.add(c);
     146            }
     147        } finally {
     148            ds.endUpdate();
    145149        }
    146         ds.endUpdate();
    147150
    148151        for (Node n : affectedNodes) {
Note: See TracChangeset for help on using the changeset viewer.