From e003b9853da92e9e0e5227094b2c55f6a67d98be Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 24 Jan 2007 02:45:04 +0000 Subject: [PATCH] another bug. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1880 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/FingerprintMap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/model/FingerprintMap.java b/core/src/main/java/hudson/model/FingerprintMap.java index daef1e67c9..d0df9c06d9 100644 --- a/core/src/main/java/hudson/model/FingerprintMap.java +++ b/core/src/main/java/hudson/model/FingerprintMap.java @@ -116,7 +116,7 @@ public final class FingerprintMap { // the fingerprint doesn't seem to be loaded thus far, so let's load it now. // the care needs to be taken that other threads might be trying to do the same. Loading l = new Loading(); - if(!(value==null ? core.putIfAbsent(md5sum,l)!=null : core.replace(md5sum,value,l))) { + if(value==null ? core.putIfAbsent(md5sum,l)!=null : !core.replace(md5sum,value,l)) { // the value has changed since then. another thread is attempting to do the same. // go back to square 1 and try it again. continue; @@ -130,7 +130,7 @@ public final class FingerprintMap { if(fp!=null) core.put(md5sum,new WeakReference(fp)); else - core.put(md5sum,null); + core.remove(md5sum); return fp; }