### Eclipse Workspace Patch 1.0
#P JOSM
|
|
|
58 | 58 | return user; |
59 | 59 | } |
60 | 60 | |
| 61 | |
| 62 | private static User lastUser = null; |
| 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 | if (lastUser != null && lastUser.getId() == uid){ |
| 74 | return lastUser; |
| 75 | } |
| 76 | |
| 77 | Long ouid = uid; |
| 78 | User user = userMap.get(ouid); |
70 | 79 | if (user == null) { |
71 | 80 | user = new User(uid, name); |
72 | | userMap.put(user.getId(), user); |
| 81 | userMap.put(ouid, user); |
73 | 82 | } |
74 | 83 | if (name != null) user.addName(name); |
| 84 | |
| 85 | lastUser = user; |
| 86 | |
75 | 87 | return user; |
76 | 88 | } |
77 | 89 | |