From 2707167e9fc2bfe596cb87f766507644509816e7 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 14 Mar 2017 00:23:54 +0100 Subject: [PATCH] Fix checkstyle FinalClass issue 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 --- .../odlparent/bundlestest/BundleDiagInfos.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/BundleDiagInfos.java b/bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/BundleDiagInfos.java index 8a53d68b8..7f030fc5a 100644 --- a/bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/BundleDiagInfos.java +++ b/bundles-test/src/main/java/org/opendaylight/odlparent/bundlestest/BundleDiagInfos.java @@ -28,7 +28,7 @@ import org.osgi.framework.BundleContext; * * @author Michael Vorburger.ch */ -public class BundleDiagInfos { +public final class BundleDiagInfos { private final List okBundleStateInfoTexts; private final List nokBundleStateInfoTexts; @@ -38,6 +38,14 @@ public class BundleDiagInfos { private static final Map WHITELISTED_BUNDLES = ImmutableMap.of( "slf4j.log4j12", Installed); + private BundleDiagInfos(List okBundleStateInfoTexts, List nokBundleStateInfoTexts, + List whitelistedBundleStateInfoTexts, Map 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 okBundleStateInfoTexts = new ArrayList<>(); List nokBundleStateInfoTexts = new ArrayList<>(); @@ -106,14 +114,6 @@ public class BundleDiagInfos { } } - private BundleDiagInfos(List okBundleStateInfoTexts, List nokBundleStateInfoTexts, - List whitelistedBundleStateInfoTexts, Map 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; -- 2.36.6