Changeset 6980 in josm for trunk


Ignore:
Timestamp:
2014-04-15T13:29:31+02:00 (11 years ago)
Author:
Don-vip
Message:

see #9634 - fix sonar issue - inconsistent synchronization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java

    r6977 r6980  
    9595        // First, download primitives
    9696        mainTask = new DownloadPrimitivesTask(tmpLayer, ids, full, getProgressMonitor().createSubTaskMonitor(1, false));
    97         currentTask = mainTask;
    98         synchronized(this) {
     97        synchronized(this) {
     98            currentTask = mainTask;
    9999            if(canceled) {
    100100                currentTask = null;
     
    121121    @Override
    122122    protected void finish() {
    123         if(canceled)
    124             return;
     123        synchronized(this) {
     124            if(canceled)
     125                return;
     126        }
    125127
    126128        // Append downloaded data to JOSM
     
    183185     */
    184186    public List<PrimitiveId> getDownloadedId() {
    185         if(canceled)
    186             return null;
     187        synchronized(this) {
     188            if(canceled)
     189                return null;
     190        }
    187191        ArrayList<PrimitiveId> downloaded = new ArrayList<PrimitiveId>(ids);
    188192        downloaded.removeAll(mainTask.getMissingPrimitives());
Note: See TracChangeset for help on using the changeset viewer.