Index: trunk/src/org/openstreetmap/josm/data/osm/User.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/User.java	(revision 8154)
+++ trunk/src/org/openstreetmap/josm/data/osm/User.java	(revision 8155)
@@ -10,5 +10,4 @@
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.atomic.AtomicLong;
 
 import org.openstreetmap.josm.tools.Utils;
@@ -25,5 +24,5 @@
 public final class User {
 
-    private static AtomicLong uidCounter = new AtomicLong();
+    private static long uidCounter = 0;
 
     /**
@@ -31,8 +30,14 @@
      */
     private static Map<Long,User> userMap = new HashMap<>();
+
+    /**
+     * The anonymous user is a local user used in places where no user is known.
+     * @see #getAnonymous()
+     */
     private static final User anonymous = createLocalUser(tr("<anonymous>"));
 
     private static long getNextLocalUid() {
-        return uidCounter.decrementAndGet();
+        uidCounter--;
+        return uidCounter;
     }
 
@@ -43,10 +48,10 @@
      * @return a new local user with the given name
      */
-    public static User createLocalUser(String name) {
-        for(long i = -1; i >= uidCounter.get(); --i)
+    public static synchronized User createLocalUser(String name) {
+        for(long i = -1; i >= uidCounter; --i)
         {
-          User olduser = getById(i);
-          if(olduser != null && olduser.hasName(name))
-            return olduser;
+            User olduser = getById(i);
+            if(olduser != null && olduser.hasName(name))
+                return olduser;
         }
         User user = new User(getNextLocalUid(), name);
@@ -62,5 +67,5 @@
      * @return a new OSM user with the given name and uid
      */
-    public static User createOsmUser(long uid, String name) {
+    public static synchronized User createOsmUser(long uid, String name) {
         User user = userMap.get(uid);
         if (user == null) {
@@ -74,7 +79,6 @@
     /**
      * clears the static map of user ids to user objects
-     *
-     */
-    public static void clearUserMap() {
+     */
+    public static synchronized void clearUserMap() {
         userMap.clear();
     }
@@ -86,5 +90,5 @@
      * @return the user; null, if there is no user with  this id
      */
-    public static User getById(long uid) {
+    public static synchronized User getById(long uid) {
         return userMap.get(uid);
     }
@@ -98,5 +102,5 @@
      * no such users exist
      */
-    public static List<User> getByName(String name) {
+    public static synchronized List<User> getByName(String name) {
         if (name == null) {
             name = "";
