Changeset 4626 in josm for trunk/src/org


Ignore:
Timestamp:
2011-12-01T18:07:30+01:00 (9 years ago)
Author:
Don-vip
Message:

see #7101 and #6987 - Avoid Data consistency error in multipolygon cache after undo/redo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java

    r4624 r4626  
    5050
    5151    public final Multipolygon get(NavigatableComponent nc, Relation r) {
     52        return get(nc, r, false);
     53    }
     54
     55    public final Multipolygon get(NavigatableComponent nc, Relation r, boolean forceRefresh) {
    5256        Multipolygon multipolygon = null;
    5357        if (nc != null && r != null) {
     
    6165            }
    6266            multipolygon = map2.get(r);
    63             if (multipolygon == null) {
     67            if (multipolygon == null || forceRefresh) {
    6468                map2.put(r, multipolygon = new Multipolygon(nc, r));
    6569            }
     
    130134                    removeMultipolygonFrom((Relation) p, maps);
    131135                   
    132                 } else if (p instanceof Way) {
     136                } else if (p instanceof Way && p.getDataSet() != null) {
    133137                    for (OsmPrimitive ref : p.getReferrers()) {
    134138                        if (isMultipolygon(ref)) {
     
    139143                        }
    140144                    }
    141                 } else if (p instanceof Node) {
     145                } else if (p instanceof Node && p.getDataSet() != null) {
    142146                    maps = removeMultipolygonsReferringTo(p.getReferrers(), ds, maps);
    143147                }
Note: See TracChangeset for help on using the changeset viewer.