Fix checkstyle FinalClass issue 50/53250/1
authorDavid <david.suarez.fuentes@ericsson.com>
Mon, 13 Mar 2017 23:23:54 +0000 (00:23 +0100)
committerDavid <david.suarez.fuentes@ericsson.com>
Mon, 13 Mar 2017 23:24:13 +0000 (00:24 +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.

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

index 8a53d68b88edafd68ed4fe8d433635b3769fc31e..7f030fc5abcac23b482b89df469014c2be1da3b9 100644 (file)
@@ -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;