Index: trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java	(revision 5363)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java	(revision 5364)
@@ -587,7 +587,7 @@
         state = State.improving;
 
-        List<OsmPrimitive> currentSelection = (List<OsmPrimitive>) getCurrentDataSet().getSelected();
+        Collection<OsmPrimitive> currentSelection = getCurrentDataSet().getSelected();
         if (currentSelection.size() != 1
-                || !currentSelection.get(0).equals(targetWay)) {
+                || !currentSelection.iterator().next().equals(targetWay)) {
             selectionChangedBlocked = true;
             getCurrentDataSet().clearSelection();
