Index: applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java
===================================================================
--- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 19231)
+++ applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java	(revision 19232)
@@ -180,4 +180,5 @@
         return loading;
     }
+
     public void setLoaded(boolean loaded) {
         this.loaded = loaded;
@@ -209,10 +210,41 @@
     }
 
+    /**
+     * Note that the hash code does not include the {@link #source}. 
+     * Therefore a hash based collection can only contain tiles
+     * of one {@link #source}. 
+     */
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + xtile;
+        result = prime * result + ytile;
+        result = prime * result + zoom;
+        return result;
+    }
+
+    /**
+     * Compares this object with <code>obj</code> based on 
+     * the fields {@link #xtile}, {@link #ytile} and 
+     * {@link #zoom}.
+     * The {@link #source} field is ignored.
+     */
     @Override
     public boolean equals(Object obj) {
-        if (!(obj instanceof Tile))
-            return false;
-        Tile tile = (Tile) obj;
-        return (xtile == tile.xtile) && (ytile == tile.ytile) && (zoom == tile.zoom);
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        Tile other = (Tile) obj;
+        if (xtile != other.xtile)
+            return false;
+        if (ytile != other.ytile)
+            return false;
+        if (zoom != other.zoom)
+            return false;
+        return true;
     }
 
@@ -220,4 +252,5 @@
         return zoom + "/" + xtile + "/" + ytile + "@" + source.getName();
     }
+
     public String getStatus() {
         String status = "new";
@@ -230,4 +263,5 @@
         return status;
     }
+
     public boolean hasError() {
         return error;
