Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 3651)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 3652)
@@ -593,4 +593,9 @@
                     if (ntsel == null && nd.isSelected()) {
                         ntsel = nd;
+                        // if there are multiple nearest nodes, prefer the one
+                        // that is selected. This is required in order to drag
+                        // the selected node if multiple nodes have the same
+                        // coordinates (e.g. after unglue)
+                        use_selected |= (distSq == minDistSq);
                     }
                     // find the nearest newest node that is within about the same
@@ -604,8 +609,7 @@
             // take nearest selected, nearest new or true nearest node to p, in that order
             n = (ntsel != null && use_selected) ? ntsel
-                    : ((ntnew != null) ? ntnew
-                            : nlists.values().iterator().next().get(0));
-        }
-
+                    : (ntnew != null) ? ntnew
+                            : nlists.values().iterator().next().get(0);
+        }
         return n;
     }
@@ -994,5 +998,5 @@
      * @return o as collection of o's type.
      */
-    public final static <T> Collection<T> asColl(T o) {
+    public static <T> Collection<T> asColl(T o) {
         if (o == null)
             return Collections.emptySet();
@@ -1000,5 +1004,5 @@
     }
 
-    public final static double perDist(Point2D pt, Point2D a, Point2D b) {
+    public static double perDist(Point2D pt, Point2D a, Point2D b) {
         if (pt != null && a != null && b != null) {
             double pd = (
@@ -1018,5 +1022,5 @@
      *      with its orthogonal line running through pt
      */
-    public final static Point2D project(Point2D pt, Point2D a, Point2D b) {
+    public static Point2D project(Point2D pt, Point2D a, Point2D b) {
         if (pt != null && a != null && b != null) {
             double r = ((
@@ -1038,5 +1042,5 @@
      * @return new point at a + r*(ab)
      */
-    public final static Point2D project(double r, Point2D a, Point2D b) {
+    public static Point2D project(double r, Point2D a, Point2D b) {
         Point2D ret = null;
 
