### Eclipse Workspace Patch 1.0
#P JOSM
|
|
|
|
| 58 | 58 | return user; |
| 59 | 59 | } |
| 60 | 60 | |
| | 61 | private static long lastUid = 0; |
| | 62 | private static Long lastUidObj = lastUid; |
| | 63 | |
| 61 | 64 | /** |
| 62 | 65 | * Creates a user known to the OSM server |
| 63 | 66 | * |
| … |
… |
|
| 66 | 69 | * @return a new OSM user with the given name and uid |
| 67 | 70 | */ |
| 68 | 71 | public static synchronized User createOsmUser(long uid, String name) { |
| 69 | | User user = userMap.get(uid); |
| | 72 | |
| | 73 | final Long uidObj; |
| | 74 | |
| | 75 | if (lastUid == uid){ |
| | 76 | uidObj = lastUidObj; |
| | 77 | } |
| | 78 | else { |
| | 79 | lastUid = uid; |
| | 80 | lastUidObj = uid; |
| | 81 | uidObj = lastUidObj; |
| | 82 | } |
| | 83 | |
| | 84 | User user = userMap.get(uidObj); |
| 70 | 85 | if (user == null) { |
| 71 | 86 | user = new User(uid, name); |
| 72 | | userMap.put(user.getId(), user); |
| | 87 | userMap.put(uidObj, user); |
| 73 | 88 | } |
| 74 | 89 | if (name != null) user.addName(name); |
| 75 | 90 | return user; |