diff --git a/src/main/java/net/spy/memcached/ArcusClient.java b/src/main/java/net/spy/memcached/ArcusClient.java index 92ccbc2b5..1ff3a4b3b 100644 --- a/src/main/java/net/spy/memcached/ArcusClient.java +++ b/src/main/java/net/spy/memcached/ArcusClient.java @@ -184,8 +184,8 @@ * } */ public class ArcusClient extends FrontCacheMemcachedClient implements ArcusClientIF { - - private static String VERSION = "INIT"; + private static String VERSION = null; + private static final Object VERSION_LOCK = new Object(); private static final Logger arcusLogger = LoggerFactory.getLogger(ArcusClient.class); private static final String ARCUS_CLOUD_ADDR = "127.0.0.1:2181"; private static final String DEFAULT_ARCUS_CLIENT_NAME = "ArcusClient"; @@ -4273,11 +4273,11 @@ private void checkDupKey(Collection keyList) { * @return version string */ public static String getVersion() { - if (!VERSION.equals("INIT")) { + if (VERSION != null) { return VERSION; } - synchronized (VERSION) { - if (VERSION.equals("INIT")) { + synchronized (VERSION_LOCK) { + if (VERSION == null) { Enumeration resEnum; try { resEnum = Thread.currentThread() @@ -4298,7 +4298,7 @@ public static String getVersion() { } catch (Exception e) { // Failed to get version. } finally { - if (VERSION.equals("INIT")) { + if (VERSION == null) { VERSION = "NONE"; } }