Changeset 12350 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/SelectCommand.java
r12349 r12350 59 59 @Override 60 60 public void undoCommand() { 61 ensurePrimitivesAreInDataset(); 62 61 63 getAffectedDataSet().setSelected(oldSelection); 62 64 } … … 64 66 @Override 65 67 public boolean executeCommand() { 68 ensurePrimitivesAreInDataset(); 69 66 70 oldSelection = getAffectedDataSet().getSelected(); 67 71 getAffectedDataSet().setSelected(newSelection); 68 72 return true; 73 } 74 75 @Override 76 public Collection<? extends OsmPrimitive> getParticipatingPrimitives() { 77 return Collections.unmodifiableCollection(newSelection); 69 78 } 70 79 -
trunk/test/unit/org/openstreetmap/josm/command/SelectCommandTest.java
r10758 r12350 123 123 @Test 124 124 public void testGetParticipatingPrimitives() { 125 SelectCommand command = new SelectCommand(Arrays.asList(testData.existingNode , testData.existingWay));125 SelectCommand command = new SelectCommand(Arrays.asList(testData.existingNode)); 126 126 command.executeCommand(); 127 assertArrayEquals(new Object[] { }, command.getParticipatingPrimitives().toArray());127 assertArrayEquals(new Object[] { testData.existingNode }, command.getParticipatingPrimitives().toArray()); 128 128 } 129 129
Note:
See TracChangeset
for help on using the changeset viewer.