Make sure QNameFactory cache is constant 91/14491/1
authorRobert Varga <rovarga@cisco.com>
Mon, 26 Jan 2015 14:00:58 +0000 (15:00 +0100)
committerRobert Varga <rovarga@cisco.com>
Mon, 26 Jan 2015 14:38:18 +0000 (15:38 +0100)
The cache is constant, there is no reason it should be non-final.

Change-Id: I663352473e6a9e6021c3cee56ddf0336e5f8e2ac
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java

index 5a8f522..c63266f 100644 (file)
@@ -19,11 +19,12 @@ public class QNameFactory {
 
     private static final int MAX_QNAME_CACHE_SIZE = 10000;
 
-    private static LoadingCache<String, QName> cache = CacheBuilder.newBuilder()
+    private static final LoadingCache<String, QName> CACHE = CacheBuilder.newBuilder()
         .maximumSize(MAX_QNAME_CACHE_SIZE)
         .softValues()
         .build(
             new CacheLoader<String, QName>() {
+                @Override
                 public QName load(String key) {
                     return QName.create(key);
                 }
@@ -32,6 +33,6 @@ public class QNameFactory {
 
 
     public static QName create(String name){
-        return cache.getUnchecked(name);
+        return CACHE.getUnchecked(name);
     }
 }