Index: trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 6639)
@@ -8,5 +8,4 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
-import java.awt.geom.Area;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -338,5 +337,4 @@
 
         // TODO: Only display this warning when nodes outside dataSourceArea are deleted
-        Area dataSourceArea = Main.main.getCurrentDataSet().getDataSourceArea();
         boolean ok = Command.checkAndConfirmOutlyingOperation("joinarea", tr("Join area confirmation"),
                 trn("The selected way has nodes outside of the downloaded data region.",
@@ -347,5 +345,5 @@
                     + tr("Please abort if you are not sure"),
                 tr("The selected area is incomplete. Continue?"),
-                dataSourceArea, allNodes, null);
+                allNodes, null);
         if(!ok) return;
 
Index: trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java	(revision 6639)
@@ -49,5 +49,5 @@
 
     protected boolean confirmWayWithNodesOutsideBoundingBox(List<? extends OsmPrimitive> primitives) {
-        return DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getEditLayer(), primitives, null);
+        return DeleteCommand.checkAndConfirmOutlyingDelete(primitives, null);
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java	(revision 6639)
@@ -438,5 +438,5 @@
                         + "This will cause problems because you don''t see the real object."
                         + "<br>" + "Do you really want to unglue?"),
-                getEditLayer().data.getDataSourceArea(), primitives, null);
+                primitives, null);
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/Command.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/Command.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/command/Command.java	(revision 6639)
@@ -191,5 +191,4 @@
      * @param outsideDialogMessage the message text to be displayed when data is outside of the download area
      * @param incompleteDialogMessage the message text to be displayed when data is incomplete
-     * @param area the area used to determine whether data is outlying
      * @param primitives the primitives to operate on
      * @param ignore {@code null} or a primitive to be ignored
@@ -198,5 +197,5 @@
     public static boolean checkAndConfirmOutlyingOperation(String operation,
             String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage,
-            Area area, Collection<? extends OsmPrimitive> primitives,
+            Collection<? extends OsmPrimitive> primitives,
             Collection<? extends OsmPrimitive> ignore) {
         boolean outside = false;
@@ -205,5 +204,5 @@
             if (osm.isIncomplete()) {
                 incomplete = true;
-            } else if (area != null && isOutlying(osm, area)
+            } else if (osm.isOutsideDownloadArea()
                     && (ignore == null || !ignore.contains(osm))) {
                 outside = true;
@@ -241,16 +240,3 @@
     }
 
-    private static boolean isOutlying(OsmPrimitive osm, Area area) {
-        if (osm instanceof Node && !osm.isNewOrUndeleted()) {
-            return !((Node) osm).getCoor().isIn(area);
-        } else if (osm instanceof Way) {
-            for (Node n : ((Way) osm).getNodes()) {
-                if (isOutlying(n, area)) {
-                    return true;
-                }
-            }
-            return false;
-        }
-        return false;
-    }
 }
Index: trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 6639)
@@ -7,5 +7,4 @@
 
 import java.awt.GridBagLayout;
-import java.awt.geom.Area;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -253,5 +252,5 @@
         if (parents.isEmpty())
             return null;
-        if (!silent && !checkAndConfirmOutlyingDelete(layer, parents, null))
+        if (!silent && !checkAndConfirmOutlyingDelete(parents, null))
             return null;
         return new DeleteCommand(layer,parents);
@@ -355,5 +354,5 @@
         }
 
-        if (!silent && !checkAndConfirmOutlyingDelete(layer,
+        if (!silent && !checkAndConfirmOutlyingDelete(
                 primitivesToDelete, Utils.filteredCollection(primitivesToDelete, Way.class)))
             return null;
@@ -450,9 +449,5 @@
     }
 
-    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, Collection<? extends OsmPrimitive> ignore) {
+    public static boolean checkAndConfirmOutlyingDelete(Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) {
         return Command.checkAndConfirmOutlyingOperation("delete",
                 tr("Delete confirmation"),
@@ -466,5 +461,5 @@
                         + "This will cause problems because you don''t see the real object."
                         + "<br>" + "Do you really want to delete?"),
-                area, primitives, ignore);
+                primitives, ignore);
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/Node.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Node.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/data/osm/Node.java	(revision 6639)
@@ -376,3 +376,9 @@
         return false;
     }
+
+    @Override
+    public boolean isOutsideDownloadArea() {
+        return !isNewOrUndeleted() && getDataSet() != null && getDataSet().getDataSourceArea() != null
+                && !getCoor().isIn(getDataSet().getDataSourceArea());
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 6639)
@@ -1367,3 +1367,9 @@
      */
     public abstract boolean concernsArea();
+
+    /**
+     * Tests if this primitive lies outside of the downloaded area of its {@link DataSet}.
+     * @return {@code true} if this primitive lies outside of the downloaded area
+     */
+    public abstract boolean isOutsideDownloadArea();
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/Relation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/data/osm/Relation.java	(revision 6639)
@@ -550,3 +550,8 @@
         return isMultipolygon() && hasAreaTags();
     }
+
+    @Override
+    public boolean isOutsideDownloadArea() {
+        return false;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/osm/Way.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 6639)
@@ -726,3 +726,13 @@
         return hasAreaTags();
     }
+
+    @Override
+    public boolean isOutsideDownloadArea() {
+        for (final Node n : nodes) {
+            if (n.isOutsideDownloadArea()) {
+                return true;
+            }
+        }
+        return false;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/BarriersEntrances.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/BarriersEntrances.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/BarriersEntrances.java	(revision 6639)
@@ -27,5 +27,5 @@
     @Override
     public void visit(Node n) {
-        if (n.hasTag("barrier", "entrance")) {
+        if (n.hasTag("barrier", "entrance") && !n.isOutsideDownloadArea()) {
             for (OsmPrimitive p : n.getReferrers()) {
                 if (p.hasKey("barrier")) {
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 6639)
@@ -409,5 +409,5 @@
             }
 
-            if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, Collections.singleton(target)))
+            if (DeleteCommand.checkAndConfirmOutlyingDelete(nodes, Collections.singleton(target)))
                 return MergeNodesAction.mergeNodes(Main.main.getEditLayer(), nodes, target);
         }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java	(revision 6638)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java	(revision 6639)
@@ -64,5 +64,6 @@
 
     private void testForError(Way w, Node wayNode, OsmPrimitive p) {
-        if (isArea(p)) {
+        if (wayNode.isOutsideDownloadArea()) {
+        } else if (isArea(p)) {
             addError(w, wayNode, p);
         } else {
