Changeset 19227 in josm for trunk/src


Ignore:
Timestamp:
2024-09-19T15:38:39+02:00 (4 months ago)
Author:
taylor.smock
Message:

Fix #20908: IllegalStateException: JOSM expected to find primitive in dataset after undoing a Parallel mode action

The test acts (roughly) like a user would, and performs click and drags via a new
utility class (MapModeUtils) which has various methods for performing mouse
actions on the map view.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r19050 r19227  
    1313import java.awt.event.KeyEvent;
    1414import java.awt.event.MouseEvent;
     15import java.util.ArrayList;
    1516import java.util.Collection;
    1617import java.util.Collections;
     
    1819import java.util.EnumSet;
    1920import java.util.LinkedHashSet;
     21import java.util.List;
    2022import java.util.Map;
    2123import java.util.Optional;
     
    287289        // Since the created way is left selected, we need to unselect again here
    288290        if (pWays != null && pWays.getWays() != null) {
    289             getLayerManager().getEditDataSet().clearSelection(pWays.getWays());
     291            final List<Way> ways = new ArrayList<>(pWays.getWays());
     292            ways.removeIf(w -> w.getDataSet() == null);
     293            getLayerManager().getEditDataSet().clearSelection(ways);
    290294            pWays = null;
    291295        }
Note: See TracChangeset for help on using the changeset viewer.