- Timestamp:
- 2017-11-05T15:15:30+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java
r12636 r13082 43 43 private static final MultipolygonCache INSTANCE = new MultipolygonCache(); 44 44 45 private final Map<DataSet, Map<Relation, Multipolygon>> cache ;46 47 private final Collection<PolyData> selectedPolyData ;45 private final Map<DataSet, Map<Relation, Multipolygon>> cache = new ConcurrentHashMap<>(); // see ticket 11833 46 47 private final Collection<PolyData> selectedPolyData = new ArrayList<>(); 48 48 49 49 private MultipolygonCache() { 50 this.cache = new ConcurrentHashMap<>(); // see ticket 1183351 this.selectedPolyData = new ArrayList<>();52 50 Main.addProjectionChangeListener(this); 53 51 DataSet.addSelectionListener(this); … … 92 90 multipolygon = new Multipolygon(r); 93 91 map2.put(r, multipolygon); 94 for (PolyData pd : multipolygon.getCombinedPolygons()) { 95 if (pd.isSelected()) { 96 selectedPolyData.add(pd); 92 synchronized (this) { 93 for (PolyData pd : multipolygon.getCombinedPolygons()) { 94 if (pd.isSelected()) { 95 selectedPolyData.add(pd); 96 } 97 97 } 98 98 } … … 294 294 295 295 @Override 296 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {296 public synchronized void selectionChanged(Collection<? extends OsmPrimitive> newSelection) { 297 297 298 298 for (Iterator<PolyData> it = selectedPolyData.iterator(); it.hasNext();) {
Note:
See TracChangeset
for help on using the changeset viewer.