Ignore:
Timestamp:
2018-02-12T23:19:49+01:00 (6 years ago)
Author:
bastiK
Message:

fixed #11607 - RangeViolatedError: the new range must be within a single subrange

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/PurgeCommand.java

    r13173 r13420  
    115115                }
    116116            }
     117            getAffectedDataSet().clearMappaintCache();
    117118        } finally {
    118119            getAffectedDataSet().endUpdate();
     
    126127            return;
    127128
    128         for (OsmPrimitive osm : toPurge) {
    129             PrimitiveData data = makeIncompleteDataByPrimId.get(osm);
    130             if (data != null) {
    131                 if (getAffectedDataSet().getPrimitiveById(osm) != osm)
    132                     throw new AssertionError(
    133                             String.format("Primitive %s has been made incomplete when purging, but it cannot be found on undo.", osm));
    134                 osm.load(data);
    135             } else {
    136                 if (getAffectedDataSet().getPrimitiveById(osm) != null)
    137                     throw new AssertionError(String.format("Primitive %s was removed when purging, but is still there on undo", osm));
    138                 getAffectedDataSet().addPrimitive(osm);
    139             }
    140         }
    141 
    142         for (Conflict<?> conflict : purgedConflicts) {
    143             getAffectedDataSet().getConflicts().add(conflict);
     129        getAffectedDataSet().beginUpdate();
     130        try {
     131            for (OsmPrimitive osm : toPurge) {
     132                PrimitiveData data = makeIncompleteDataByPrimId.get(osm);
     133                if (data != null) {
     134                    if (getAffectedDataSet().getPrimitiveById(osm) != osm)
     135                        throw new AssertionError(
     136                                String.format("Primitive %s has been made incomplete when purging, but it cannot be found on undo.", osm));
     137                    osm.load(data);
     138                } else {
     139                    if (getAffectedDataSet().getPrimitiveById(osm) != null)
     140                        throw new AssertionError(String.format("Primitive %s was removed when purging, but is still there on undo", osm));
     141                    getAffectedDataSet().addPrimitive(osm);
     142                }
     143            }
     144
     145            for (Conflict<?> conflict : purgedConflicts) {
     146                getAffectedDataSet().getConflicts().add(conflict);
     147            }
     148            getAffectedDataSet().clearMappaintCache();
     149        } finally {
     150            getAffectedDataSet().endUpdate();
    144151        }
    145152    }
Note: See TracChangeset for help on using the changeset viewer.