- Timestamp:
- 2017-02-26T02:13:15+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r11627 r11629 61 61 * 62 62 * Dataset is threadsafe - accessing Dataset simultaneously from different threads should never 63 * lead to data corruption or Conc curentModificationException. However when for example one thread63 * lead to data corruption or ConcurrentModificationException. However when for example one thread 64 64 * removes primitive and other thread try to add another primitive referring to the removed primitive, 65 65 * DataIntegrityException will occur. … … 966 966 967 967 @Override 968 public Collection<DataSource> getDataSources() {968 public synchronized Collection<DataSource> getDataSources() { 969 969 return Collections.unmodifiableCollection(dataSources); 970 970 } … … 1383 1383 if (from != null) { 1384 1384 new DataSetMerger(this, from).merge(progressMonitor); 1385 if (!from.dataSources.isEmpty()) { 1386 if (dataSources.addAll(from.dataSources)) { 1387 cachedDataSourceArea = null; 1388 cachedDataSourceBounds = null; 1385 synchronized (from) { 1386 if (!from.dataSources.isEmpty()) { 1387 if (dataSources.addAll(from.dataSources)) { 1388 cachedDataSourceArea = null; 1389 cachedDataSourceBounds = null; 1390 } 1391 from.dataSources.clear(); 1392 from.cachedDataSourceArea = null; 1393 from.cachedDataSourceBounds = null; 1389 1394 } 1390 from.dataSources.clear();1391 from.cachedDataSourceArea = null;1392 from.cachedDataSourceBounds = null;1393 1395 } 1394 1396 } … … 1403 1405 } 1404 1406 1405 public ProjectionBounds getDataSourceBoundingBox() { 1407 /** 1408 * Returns the data sources bounding box. 1409 * @return the data sources bounding box 1410 */ 1411 public synchronized ProjectionBounds getDataSourceBoundingBox() { 1406 1412 BoundingXYVisitor bbox = new BoundingXYVisitor(); 1407 1413 for (DataSource source : dataSources) { … … 1413 1419 return null; 1414 1420 } 1415 1416 1421 }
Note:
See TracChangeset
for help on using the changeset viewer.