Ignore:
Timestamp:
2009-11-18T18:50:38+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed #3963: Synchronize does not work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/User.java

    r2455 r2471  
    77import java.util.HashMap;
    88import java.util.List;
     9import java.util.concurrent.atomic.AtomicLong;
    910
    1011/**
     
    1819 */
    1920public class User {
    20     static private long uidCounter = 0;
     21
     22    static private AtomicLong uidCounter = new AtomicLong();
     23
    2124    /**
    2225     * the map of known users
     
    2730    private static long getNextLocalUid() {
    2831        synchronized(User.class) {
    29             uidCounter--;
    30             return uidCounter;
     32            return uidCounter.decrementAndGet();
    3133        }
    3234    }
     
    6062    }
    6163
     64    /**
     65     * clears the static map of user ids to user objects
     66     *
     67     */
     68    public static void clearUserMap() {
     69        userMap.clear();
     70    }
    6271
    6372    /**
Note: See TracChangeset for help on using the changeset viewer.