### Eclipse Workspace Patch 1.0
#P JOSM
Index: src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 5114)
+++ src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(working copy)
@@ -21,8 +21,11 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.Set;
+import java.util.Timer;
+import java.util.TimerTask;
 
 import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.MergeNodesAction;
@@ -193,6 +196,45 @@
         removeHighlighting();
     }
 
+    private int saved = 0;
+    private final Timer requestRepaintTimer = new Timer();
+    private final Runnable repaintRunnable = new Runnable() {
+        @Override
+        public void run() {
+            mv.repaint();
+            saved--;
+            System.out.println("repaint!" + saved);
+        }
+    };
+
+    class RequestRepaintTimerTask extends TimerTask {
+        @Override
+        public void run() {
+
+            SwingUtilities.invokeLater(repaintRunnable);
+
+        }
+    }
+    private TimerTask requestRepaintTimerTask = null;
+    private void requestRepaint() {
+        if(requestRepaintTimerTask != null) {
+            requestRepaintTimerTask.cancel();
+        }
+        saved++;
+        requestRepaintTimer.purge();
+        requestRepaintTimerTask = new RequestRepaintTimerTask();
+        requestRepaintTimer.schedule(requestRepaintTimerTask, 25);
+    }
+
+    private synchronized void requestRepaintNow() {
+        if(requestRepaintTimerTask != null) {
+            requestRepaintTimerTask.cancel();
+        }
+        requestRepaintTimer.purge();
+        System.out.println("repaint now!");
+        mv.repaint();
+    }
+
     /**
      * works out which cursor should be displayed for most of SelectAction's
      * features. The only exception is the "move" cursor when actually dragging
@@ -354,7 +396,7 @@
         // We don't have a mouse event, so we pass the old mouse event but the
         // new modifiers.
         if(giveUserFeedback(oldEvent, ((InputEvent) e).getModifiers())) {
-            mv.repaint();
+            requestRepaintNow();
         }
     }
 
@@ -403,7 +445,7 @@
             // when dragging a node onto another one and then press CTRL to merge
             oldEvent = e;
             if(needsRepaint) {
-                mv.repaint();
+                requestRepaintNow();
             }
         }
 
@@ -461,7 +503,7 @@
                 return;
 
             Command c = !Main.main.undoRedo.commands.isEmpty()
-                    ? Main.main.undoRedo.commands.getLast() : null;
+            ? Main.main.undoRedo.commands.getLast() : null;
             if (c instanceof SequenceCommand) {
                 c = ((SequenceCommand) c).getLastCommand();
             }
@@ -503,7 +545,7 @@
             }
         }
 
-        mv.repaint();
+        requestRepaintNow();
         if (mode != Mode.scale) {
             lastMousePos = e.getPoint();
         }
@@ -520,14 +562,14 @@
         }
         oldEvent = e;
         if(giveUserFeedback(e)) {
-            mv.repaint();
+            requestRepaint();
         }
     }
 
     @Override
     public void mouseExited(MouseEvent e) {
         if(removeHighlighting()) {
-            mv.repaint();
+            requestRepaint();
         }
     }
 
@@ -731,7 +773,7 @@
             break;
         }
         giveUserFeedback(e);
-        mv.repaint();
+        requestRepaintNow();
         updateStatusLine();
     }
 
