Index: trunk/src/org/openstreetmap/josm/command/Command.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/Command.java	(revision 5059)
+++ trunk/src/org/openstreetmap/josm/command/Command.java	(revision 5060)
@@ -177,21 +177,14 @@
     public static boolean checkAndConfirmOutlyingOperation(String operation,
             String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage,
-            Area area, Collection<? extends OsmPrimitive> primitives, OsmPrimitive ignore) {
+            Area area, Collection<? extends OsmPrimitive> primitives,
+            Collection<? extends OsmPrimitive> ignore) {
         boolean outside = false;
         boolean incomplete = false;
-        if (area != null) {
-            for (OsmPrimitive osm : primitives) {
-                if (osm.isIncomplete()) {
-                    incomplete = true;
-                } else if (isOutlying(osm, area)
-                        && (ignore == null || !ignore.equals(osm))) {
-                    outside = true;
-                }
-            }
-        } else {
-            for (OsmPrimitive osm : primitives) {
-                if (osm.isIncomplete()) {
-                    incomplete = true;
-                }
+        for (OsmPrimitive osm : primitives) {
+            if (osm.isIncomplete()) {
+                incomplete = true;
+            } else if (area != null && isOutlying(osm, area)
+                    && (ignore == null || !ignore.contains(osm))) {
+                outside = true;
             }
         }
Index: trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 5059)
+++ trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 5060)
@@ -358,5 +358,6 @@
         }
 
-        if (!silent && !checkAndConfirmOutlyingDelete(layer, primitivesToDelete, null))
+        if (!silent && !checkAndConfirmOutlyingDelete(layer,
+                primitivesToDelete, Utils.filteredCollection(primitivesToDelete, Way.class)))
             return null;
 
@@ -454,9 +455,9 @@
     }
 
-    public static boolean checkAndConfirmOutlyingDelete(OsmDataLayer layer, Collection<? extends OsmPrimitive> primitives, OsmPrimitive ignore) {
+    public static boolean checkAndConfirmOutlyingDelete(OsmDataLayer layer, Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) {
         return checkAndConfirmOutlyingDelete(layer.data.getDataSourceArea(), primitives, ignore);
     }
 
-    public static boolean checkAndConfirmOutlyingDelete(Area area, Collection<? extends OsmPrimitive> primitives, OsmPrimitive ignore) {
+    public static boolean checkAndConfirmOutlyingDelete(Area area, Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) {
         return Command.checkAndConfirmOutlyingOperation("delete",
                 tr("Delete confirmation"),
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 5059)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 5060)
@@ -7,4 +7,5 @@
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -384,5 +385,5 @@
         }
 
-        if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, target))
+        if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, Collections.singleton(target)))
             return MergeNodesAction.mergeNodes(Main.main.getEditLayer(), nodes, target);
 
