Fix checkstyle FinalClass issue 14/53314/1
authorDavid <david.suarez.fuentes@ericsson.com>
Wed, 15 Mar 2017 08:15:47 +0000 (09:15 +0100)
committerDavid <david.suarez.fuentes@ericsson.com>
Wed, 15 Mar 2017 08:15:47 +0000 (09:15 +0100)
Fix the FinalClass checkstyle violation described in this pending
change:
https://git.opendaylight.org/gerrit/#/c/43324/

Move the constructor to be the first method.

The same fix solved in this patch:
https://git.opendaylight.org/gerrit/#/c/53250/

Change-Id: I1986199ee2b761e1b73cac31f2f1630f57e73b64
Signed-off-by: David <david.suarez.fuentes@ericsson.com>
bundles4-test/src/main/java/org/opendaylight/odlparent/bundles4test/BundleDiagInfos.java

index 47d698c5a4d04190a12df6b0856d394216cfeed2..28e73819cfae2be2ebde31b4b162381e66fa9587 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Red Hat, Inc. and others. All rights reserved.
+ * Copyright (c) 2016, 2017 Red Hat, Inc. and others. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -28,7 +28,7 @@ import org.osgi.framework.BundleContext;
  *
  * @author Michael Vorburger.ch
  */
-public class BundleDiagInfos {
+public final class BundleDiagInfos {
 
     private final List<String> okBundleStateInfoTexts;
     private final List<String> nokBundleStateInfoTexts;
@@ -38,6 +38,14 @@ public class BundleDiagInfos {
     private static final Map<String, BundleState> WHITELISTED_BUNDLES = ImmutableMap.of(
             "slf4j.log4j12", Installed);
 
+    private BundleDiagInfos(List<String> okBundleStateInfoTexts, List<String> nokBundleStateInfoTexts,
+            List<String> whitelistedBundleStateInfoTexts, Map<BundleState, Integer> bundleStatesCounters) {
+        this.okBundleStateInfoTexts = ImmutableList.copyOf(okBundleStateInfoTexts);
+        this.nokBundleStateInfoTexts = ImmutableList.copyOf(nokBundleStateInfoTexts);
+        this.whitelistedBundleStateInfoTexts = ImmutableList.copyOf(whitelistedBundleStateInfoTexts);
+        this.bundleStatesCounters = ImmutableMap.copyOf(bundleStatesCounters);
+    }
+
     public static BundleDiagInfos forContext(BundleContext bundleContext, BundleService bundleService) {
         List<String> okBundleStateInfoTexts = new ArrayList<>();
         List<String> nokBundleStateInfoTexts = new ArrayList<>();
@@ -106,14 +114,6 @@ public class BundleDiagInfos {
         }
     }
 
-    private BundleDiagInfos(List<String> okBundleStateInfoTexts, List<String> nokBundleStateInfoTexts,
-            List<String> whitelistedBundleStateInfoTexts, Map<BundleState, Integer> bundleStatesCounters) {
-        this.okBundleStateInfoTexts = ImmutableList.copyOf(okBundleStateInfoTexts);
-        this.nokBundleStateInfoTexts = ImmutableList.copyOf(nokBundleStateInfoTexts);
-        this.whitelistedBundleStateInfoTexts = ImmutableList.copyOf(whitelistedBundleStateInfoTexts);
-        this.bundleStatesCounters = ImmutableMap.copyOf(bundleStatesCounters);
-    }
-
     public SystemState getSystemState() {
         if (bundleStatesCounters.get(BundleState.Failure) > 0) {
             return SystemState.Failure;