Index: src/org/openstreetmap/josm/command/Command.java
===================================================================
--- src/org/openstreetmap/josm/command/Command.java	(revision 10925)
+++ src/org/openstreetmap/josm/command/Command.java	(working copy)
@@ -242,8 +242,37 @@
         return cloneMap.keySet();
     }
 
+    /** IS_OK : operation is okay */
+    public static int IS_OK = 0;
+    /** IS_OUTSIDE : operation on element outside of download area */
+    public static int IS_OUTSIDE   = 1;
+    /** IS_INCOMPLETE: operation on incomplete target */
+    public static int IS_INCOMPLET = 2;
     /**
      * Check whether user is about to operate on data outside of the download area.
+     *
+     * @param operation the operation name which is used for setting some preferences
+     * @param primitives the primitives to operate on
+     * @param ignore {@code null} or a primitive to be ignored
+     * @return true, if operating on outlying primitives is OK; false, otherwise
+     */
+    public static int checkOutlyingOrIncompleteOperation(String operation,
+            Collection<? extends OsmPrimitive> primitives,
+            Collection<? extends OsmPrimitive> ignore) {
+        int res = 0;
+        for (OsmPrimitive osm : primitives) {
+            if (osm.isIncomplete()) {
+                res |= IS_INCOMPLET;
+            } else if (osm.isOutsideDownloadArea()
+                    && (ignore == null || !ignore.contains(osm))) {
+                res |= IS_OUTSIDE;
+            }
+        }
+        return res;
+    }
+
+    /**
+     * Check whether user is about to operate on data outside of the download area.
      * Request confirmation if he is.
      *
      * @param operation the operation name which is used for setting some preferences
@@ -258,17 +287,8 @@
             String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage,
             Collection<? extends OsmPrimitive> primitives,
             Collection<? extends OsmPrimitive> ignore) {
-        boolean outside = false;
-        boolean incomplete = false;
-        for (OsmPrimitive osm : primitives) {
-            if (osm.isIncomplete()) {
-                incomplete = true;
-            } else if (osm.isOutsideDownloadArea()
-                    && (ignore == null || !ignore.contains(osm))) {
-                outside = true;
-            }
-        }
-        if (outside) {
+        int checkRes = checkOutlyingOrIncompleteOperation(operation, primitives, ignore);
+        if ((checkRes & IS_OUTSIDE) != 0) {
             JPanel msg = new JPanel(new GridBagLayout());
             msg.add(new JMultilineLabel("<html>" + outsideDialogMessage + "</html>"));
             boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
@@ -282,7 +302,7 @@
             if (!answer)
                 return false;
         }
-        if (incomplete) {
+        if ((checkRes & IS_INCOMPLET) != 0) {
             JPanel msg = new JPanel(new GridBagLayout());
             msg.add(new JMultilineLabel("<html>" + incompleteDialogMessage + "</html>"));
             boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog(
@@ -299,6 +319,7 @@
         return true;
     }
 
+
     @Override
     public int hashCode() {
         return Objects.hash(cloneMap, layer);
Index: src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
===================================================================
--- src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 10925)
+++ src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(working copy)
@@ -20,7 +20,6 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.MergeNodesAction;
 import org.openstreetmap.josm.command.Command;
-import org.openstreetmap.josm.command.DeleteCommand;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.Hash;
 import org.openstreetmap.josm.data.osm.Node;
@@ -407,7 +406,7 @@
                 target = nodes.iterator().next();
             }
 
-            if (DeleteCommand.checkAndConfirmOutlyingDelete(nodes, Collections.singleton(target)))
+            if (Command.checkOutlyingOrIncompleteOperation("delete", nodes, Collections.singleton(target)) == Command.IS_OK)
                 return MergeNodesAction.mergeNodes(Main.getLayerManager().getEditLayer(), nodes, target);
         }
 
