Make sure MetricsReporter cache is constant 32/48632/2
authorRobert Varga <rovarga@cisco.com>
Wed, 23 Nov 2016 14:57:48 +0000 (15:57 +0100)
committerTom Pantelis <tpanteli@brocade.com>
Tue, 29 Nov 2016 17:59:54 +0000 (17:59 +0000)
Add a missing final keyword, plus the general
auto-format.

Change-Id: I0027784b6773e4b862bc58d7cc573303dcc57b31
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/reporting/MetricsReporter.java

index 3dbb612..cc64c32 100644 (file)
@@ -24,25 +24,25 @@ import com.google.common.cache.LoadingCache;
  */
 public class MetricsReporter implements AutoCloseable {
 
-    private static LoadingCache<String, MetricsReporter> METRIC_REPORTERS = CacheBuilder.newBuilder().build(
-            new CacheLoader<String, MetricsReporter>() {
-                @Override
-                public MetricsReporter load(String domainName) {
-                    return new MetricsReporter(domainName);
-                }
-            });
+    private static final LoadingCache<String, MetricsReporter> METRIC_REPORTERS = CacheBuilder.newBuilder().build(
+        new CacheLoader<String, MetricsReporter>() {
+            @Override
+            public MetricsReporter load(final String domainName) {
+                return new MetricsReporter(domainName);
+            }
+        });
 
     private final String domainName;
     private final JmxReporter jmxReporter;
     private final MetricRegistry metricRegistry = new MetricRegistry();
 
-    private MetricsReporter(String domainName) {
+    private MetricsReporter(final String domainName) {
         this.domainName = domainName;
         jmxReporter = JmxReporter.forRegistry(metricRegistry).inDomain(domainName).build();
         jmxReporter.start();
     }
 
-    public static MetricsReporter getInstance(String domainName) {
+    public static MetricsReporter getInstance(final String domainName) {
         return METRIC_REPORTERS.getUnchecked(domainName);
     }