Workaround the merge key dialog popup by removing the building key and adding it again (for tests)

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2019-10-21 15:01:00 -06:00
rodzic 2656173cc3
commit 2e3b90d3eb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
1 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -80,7 +80,17 @@ public class MergeAddressBuildings extends AbstractConflationCommand {
final List<Command> commandList = new ArrayList<>();
if (nodesWithAddresses.size() == 1) {
commandList.add(ReplaceGeometryUtils.buildUpgradeNodeCommand(nodesWithAddresses.get(0), object));
String currentKey = null;
try {
// Remove the key to avoid the popup from utilsplugin2
currentKey = object.get(BUILDING_KEY);
object.remove(BUILDING_KEY);
commandList.add(ReplaceGeometryUtils.buildUpgradeNodeCommand(nodesWithAddresses.get(0), object));
} finally {
if (currentKey != null) {
object.put(BUILDING_KEY, currentKey);
}
}
}
return commandList;
}