Index: /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 2418)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 2419)
@@ -756,5 +756,7 @@
      * Reindex all nodes and ways after their coordinates were changed. This is a temporary solution, reindexing should
      * be automatic in the future
-     */
+     * @deprecated Reindexing should be automatic
+     */
+    @Deprecated
     public void reindexAll() {
         List<Node> ntmp = new ArrayList<Node>(nodes);
@@ -764,4 +766,18 @@
         ways.clear();
         ways.addAll(wtmp);
+    }
+
+    void reindexNode(Node node) {
+        nodes.remove(node);
+        nodes.add(node);
+        for (Way way:OsmPrimitive.getFilteredList(node.getReferrers(), Way.class)) {
+            ways.remove(way);
+            ways.add(way);
+        }
+    }
+
+    void reindexWay(Way way) {
+        ways.remove(way);
+        ways.add(way);
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/Node.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/Node.java	(revision 2418)
+++ /trunk/src/org/openstreetmap/josm/data/osm/Node.java	(revision 2419)
@@ -23,4 +23,7 @@
                 this.coor.setCoor(coor);
             }
+            if (getDataSet() != null) {
+                getDataSet().reindexNode(this);
+            }
         }
     }
@@ -37,4 +40,7 @@
             } else {
                 coor = new CachedLatLon(eastNorth);
+            }
+            if (getDataSet() != null) {
+                getDataSet().reindexNode(this);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/data/osm/Way.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 2418)
+++ /trunk/src/org/openstreetmap/josm/data/osm/Way.java	(revision 2419)
@@ -59,4 +59,5 @@
 
         clearCached();
+        reindex();
     }
 
@@ -287,4 +288,5 @@
         newNodes[nodes.length] = n;
         nodes = newNodes;
+        reindex();
     }
 
@@ -309,4 +311,5 @@
         newNodes[offs] = n;
         nodes = newNodes;
+        reindex();
     }
 
@@ -320,4 +323,5 @@
             }
         }
+        reindex();
         super.setDeleted(deleted);
     }
@@ -352,3 +356,9 @@
         return OsmPrimitiveType.WAY;
     }
+
+    private void reindex() {
+        if (getDataSet() != null) {
+            getDataSet().reindexWay(this);
+        }
+    }
 }
