From e07aac61efc6a77fe58dbd99dca28a51504897b8 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 16 Sep 2013 17:41:14 -0400 Subject: [PATCH] [JENKINS-16332] More logging at FINE in hudson.model.User. Running hypothesis: something historically saved a user configuration file with a bogus fullName; thereafter anyone calling User.get(correctFullName) will get a User with the old fullName. This would make the bug unreproducible in fresh Jenkins installations. --- core/src/main/java/hudson/model/User.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/model/User.java b/core/src/main/java/hudson/model/User.java index fe3f2d562d..a2f95c40e3 100644 --- a/core/src/main/java/hudson/model/User.java +++ b/core/src/main/java/hudson/model/User.java @@ -344,8 +344,12 @@ public class User extends AbstractModelObject implements AccessControlled, Descr if (u==null && (create || getConfigFileFor(id).exists())) { User tmp = new User(id, fullName); User prev = byName.putIfAbsent(idkey, u = tmp); - if (prev!=null) - u = prev; // if some has already put a value in the map, use it + if (prev != null) { + u = prev; // if some has already put a value in the map, use it + if (LOGGER.isLoggable(Level.FINE) && !fullName.equals(prev.getFullName())) { + LOGGER.log(Level.FINE, "mismatch on fullName (‘" + fullName + "’ vs. ‘" + prev.getFullName() + "’) for ‘" + id + "’", new Throwable()); + } + } } return u; } -- GitLab