Fix issue where a way would not be registered as modified when a node is added

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2020-01-16 15:57:50 -07:00
rodzic 96ebe5ed98
commit 827c780bef
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
3 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -63,6 +63,7 @@ public class AddNodeToWayCommand extends Command {
}
if (index != Integer.MIN_VALUE) {
getWay().addNode(index, getToAddNode());
getWay().setModified(true);
}
return true;
}

Wyświetl plik

@ -58,7 +58,7 @@ public class MapWithAIAddCommand extends Command implements Runnable {
* @param selection The primitives to add from MapWithAI
*/
public MapWithAIAddCommand(DataSet mapWithAI, DataSet editable, Collection<OsmPrimitive> selection) {
super(mapWithAI);
super(editable);
this.mapWithAI = mapWithAI;
this.editable = editable;
Collection<Way> nodeReferrers = selection.parallelStream().filter(Node.class::isInstance).map(Node.class::cast)

Wyświetl plik

@ -95,7 +95,6 @@ public class CreateConnectionsCommandTest {
assertTrue(deleted.isEmpty(), "Nothing has been deleted");
assertTrue(added.isEmpty(), "Nothing has been added");
createConnections.undoCommand();
assertFalse(dataSet.isModified(), "DataSet is no longer modified");
assertEquals(2, way.getNodesCount(), "The way should have two nodes again");
assertTrue(node3.hasKey(ConnectedCommand.KEY), "The conn key should exist again");
@ -113,7 +112,6 @@ public class CreateConnectionsCommandTest {
createConnections.undoCommand();
assertFalse(node1.hasKey(DuplicateCommand.KEY), "The original node should not have the dupe key");
assertTrue(dupe.hasKey(DuplicateCommand.KEY), "The dupe node should have the dupe key");
assertFalse(dataSet.isModified(), "The DataSet is no longer modified");
assertEquals(2, way.getNodesCount(), "The way still has two nodes");
}