Index: src/org/openstreetmap/josm/data/validation/tests/Coastlines.java
===================================================================
--- src/org/openstreetmap/josm/data/validation/tests/Coastlines.java	(revision 10992)
+++ src/org/openstreetmap/josm/data/validation/tests/Coastlines.java	(working copy)
@@ -39,6 +39,7 @@
     protected static final int WRONG_ORDER_COASTLINE = 904;
 
     private List<Way> coastlineWays;
+    private Area downloadedArea;
 
     /**
      * Constructor
@@ -51,6 +52,7 @@
     public void startTest(ProgressMonitor monitor) {
         super.startTest(monitor);
         coastlineWays = new LinkedList<>();
+        downloadedArea = null;
     }
 
     @Override
@@ -71,11 +73,7 @@
      * Nodes outside the download area are special cases, we may not know enough about the connected ways.
      */
     private void checkConnections() {
-        Area downloadedArea = null;
         for (Way w : coastlineWays) {
-            if (downloadedArea == null) {
-                downloadedArea = w.getDataSet().getDataSourceArea();
-            }
             int numNodes = w.getNodesCount();
             for (int i = 0; i < numNodes; i++) {
                 Node n = w.getNode(i);
@@ -237,6 +235,9 @@
 
         if (isCoastline(way)) {
             coastlineWays.add(way);
+            if (downloadedArea == null) {
+                downloadedArea = way.getDataSet().getDataSourceArea();
+            }
         }
     }
 
