Index: src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/JoinNodeWayAction.java	(revision 4780)
+++ src/org/openstreetmap/josm/actions/JoinNodeWayAction.java	(working copy)
@@ -35,18 +35,16 @@
     public void actionPerformed(ActionEvent e) {
         if (!isEnabled())
             return;
-        Collection<Node> selectedNodes = getCurrentDataSet().getSelectedNodes();
-        // Allow multiple selected nodes too?
-        if (selectedNodes.size() != 1) return;
+        
+        Collection<Command> cmds2 = new LinkedList<Command>();
+        for (Node node : getCurrentDataSet().getSelectedNodes()) {
 
-        Node node = selectedNodes.iterator().next();
+            Collection<Command> cmds = new LinkedList<Command>();
 
-        Collection<Command> cmds = new LinkedList<Command>();
+            // If the user has selected some ways, only join the node to these.
+            boolean restrictToSelectedWays =
+                getCurrentDataSet().getSelectedWays().size() > 0;
 
-        // If the user has selected some ways, only join the node to these.
-        boolean restrictToSelectedWays =
-            getCurrentDataSet().getSelectedWays().size() > 0;
-
             List<WaySegment> wss = Main.map.mapView.getNearestWaySegments(
                     Main.map.mapView.getPoint(node), OsmPrimitive.isSelectablePredicate);
             HashMap<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>();
@@ -86,9 +84,35 @@
                 wnew.setNodes(nodesToAdd);
                 cmds.add(new ChangeCommand(w, wnew));
             }
-            if (cmds.size() == 0) return;
-            Main.main.undoRedo.add(new SequenceCommand(tr("Join Node and Line"), cmds));
-            Main.map.repaint();
+            
+            if (!cmds.isEmpty()) {
+                SequenceCommand sc = new SequenceCommand(tr("Join Node and Line Segment"), cmds) {
+                    int state = 0;
+                    
+                    /*
+                     * override it to prevent the re-execution on final Main.main.undoRedo.add
+                     */
+                    @Override
+                    public boolean executeCommand() {
+                        switch (state) {
+                        case 0: // point A
+                            state = 1;
+                            return super.executeCommand();
+                        case 1:
+                            state = 2; // point B - skip the execution
+                            return true;
+                        default:
+                            return super.executeCommand(); // redo execution point
+                        }
+                    }
+                };
+                sc.executeCommand(); // execute it so that next iteration work on modified data (reaches point A)
+                cmds2.add(sc);
+            }
+        }
+        
+        Main.main.undoRedo.add(new SequenceCommand(tr("Join Node and Line"), cmds2)); // reaches point B
+        Main.map.repaint();
     }
 
     private static void pruneSuccsAndReverse(List<Integer> is) {
