Index: trunk/src/org/openstreetmap/josm/data/osm/Storage.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Storage.java	(revision 11394)
+++ trunk/src/org/openstreetmap/josm/data/osm/Storage.java	(revision 11395)
@@ -504,11 +504,6 @@
     }
 
-    private final class SafeReadonlyIter implements Iterator<T> {
-        private final T[] data;
-        private int slot;
-
-        SafeReadonlyIter(T[] data) {
-            this.data = data;
-        }
+    private abstract class AbstractIter implements Iterator<T> {
+        protected int slot;
 
         @Override
@@ -519,4 +514,18 @@
         }
 
+        protected void align() {
+            while (slot < data.length && data[slot] == null) {
+                slot++;
+            }
+        }
+    }
+
+    private final class SafeReadonlyIter extends AbstractIter {
+        private final T[] data;
+
+        SafeReadonlyIter(T[] data) {
+            this.data = data;
+        }
+
         @Override
         public T next() {
@@ -529,26 +538,12 @@
             throw new UnsupportedOperationException();
         }
-
-        private void align() {
-            while (slot < data.length && data[slot] == null) {
-                slot++;
-            }
-        }
-    }
-
-    private final class Iter implements Iterator<T> {
+    }
+
+    private final class Iter extends AbstractIter {
         private final int mods;
-        private int slot;
         private int removeSlot = -1;
 
         Iter() {
             mods = modCount;
-        }
-
-        @Override
-        public boolean hasNext() {
-            if (data == null) return false;
-            align();
-            return slot < data.length;
         }
 
@@ -569,12 +564,10 @@
         }
 
-        private void align() {
+        @Override
+        protected void align() {
             if (mods != modCount)
                 throw new ConcurrentModificationException();
-            while (slot < data.length && data[slot] == null) {
-                slot++;
-            }
-        }
-    }
-
+            super.align();
+        }
+    }
 }
