Index: trunk/src/org/openstreetmap/josm/command/SplitWayCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/SplitWayCommand.java	(revision 17366)
+++ trunk/src/org/openstreetmap/josm/command/SplitWayCommand.java	(revision 17367)
@@ -436,7 +436,6 @@
 
         // Change the original way
-        final Way changedWay = new Way(way);
-        changedWay.setNodes(wayToKeep.getNodes());
-        commandList.add(new ChangeNodesCommand(way, changedWay.getNodes()));
+        final List<Node> changedWayNodes = wayToKeep.getNodes();
+        commandList.add(new ChangeNodesCommand(way, changedWayNodes));
         for (Way wayToAdd : newWays) {
             commandList.add(new AddCommand(way.getDataSet(), wayToAdd));
@@ -465,5 +464,5 @@
                     boolean insert = true;
                     if (relationSpecialTypes.containsKey(type) && "restriction".equals(relationSpecialTypes.get(type))) {
-                        RelationInformation rValue = treatAsRestriction(r, rm, c, newWays, way, changedWay);
+                        RelationInformation rValue = treatAsRestriction(r, rm, c, newWays, way, changedWayNodes);
                         if (rValue.warnme) warnings.add(WarningType.GENERIC);
                         insert = rValue.insert;
@@ -570,5 +569,4 @@
             }
         }
-        changedWay.setNodes(null); // see #19885
         return new Analysis(relationAnalyses, commandList, warnings, numberOfRelations);
     }
@@ -785,5 +783,5 @@
     private static RelationInformation treatAsRestriction(Relation r,
             RelationMember rm, Relation c, Collection<Way> newWays, Way way,
-            Way changedWay) {
+            List<Node> changedWayNodes) {
         RelationInformation relationInformation = new RelationInformation();
         /* this code assumes the restriction is correct. No real error checking done */
@@ -802,5 +800,5 @@
             Way res = null;
             for (Node n : nodes) {
-                if (changedWay.isFirstLastNode(n)) {
+                if (changedWayNodes.get(0) == n || changedWayNodes.get(changedWayNodes.size() - 1) == n) {
                     res = way;
                 }
