Changeset 17379 in josm


Ignore:
Timestamp:
2020-11-30T16:33:56+01:00 (4 years ago)
Author:
GerdP
Message:

see #17196 Undo/Redo may change data in inactive layer

  • fix sonar issue: Make UndoRedoHandler.clean(Dataset dataset) static
Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r17378 r17379  
    470470     * @since 12718
    471471     */
    472     public synchronized void clean(DataSet dataSet) {
     472    public static synchronized void clean(DataSet dataSet) {
    473473        if (dataSet == null)
    474474            return;
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r17160 r17379  
    222222            Layer layer = e.getRemovedLayer();
    223223            if (layer instanceof OsmDataLayer) {
    224                 UndoRedoHandler.getInstance().clean(((OsmDataLayer) layer).getDataSet());
     224                UndoRedoHandler.clean(((OsmDataLayer) layer).getDataSet());
    225225            }
    226226        }
  • trunk/src/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTask.java

    r14153 r17379  
    121121        GuiHelper.runInEDTAndWait(() -> {
    122122            // Remove the commands from the undo stack
    123             UndoRedoHandler.getInstance().clean(uploadDataLayer.getDataSet());
     123            UndoRedoHandler.clean(uploadDataLayer.getDataSet());
    124124            MainApplication.getLayerManager().prepareLayerForUpload(uploadDataLayer);
    125125
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r17166 r17379  
    654654            return;
    655655
    656         UndoRedoHandler.getInstance().clean(data);
     656        UndoRedoHandler.clean(data);
    657657
    658658        // if uploaded, clean the modified flags as well
Note: See TracChangeset for help on using the changeset viewer.