Index: trunk/src/org/openstreetmap/josm/command/Command.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/Command.java	(revision 10946)
+++ trunk/src/org/openstreetmap/josm/command/Command.java	(revision 10948)
@@ -42,4 +42,11 @@
 public abstract class Command implements PseudoCommand {
 
+    /** IS_OK : operation is okay */
+    public static final int IS_OK = 0;
+    /** IS_OUTSIDE : operation on element outside of download area */
+    public static final int IS_OUTSIDE = 1;
+    /** IS_INCOMPLETE: operation on incomplete target */
+    public static final int IS_INCOMPLETE = 2;
+
     private static final class CloneVisitor extends AbstractVisitor {
         public final Map<OsmPrimitive, PrimitiveData> orig = new LinkedHashMap<>();
@@ -245,4 +252,27 @@
     /**
      * 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_INCOMPLETE;
+            } 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.
      *
@@ -259,15 +289,6 @@
             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>"));
@@ -283,5 +304,5 @@
                 return false;
         }
-        if (incomplete) {
+        if ((checkRes & IS_INCOMPLETE) != 0) {
             JPanel msg = new JPanel(new GridBagLayout());
             msg.add(new JMultilineLabel("<html>" + incompleteDialogMessage + "</html>"));
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 10946)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 10948)
@@ -21,5 +21,4 @@
 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;
@@ -408,5 +407,5 @@
             }
 
-            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);
         }
