From c82ecfa6783972792fea6e1edf8488418fe1986f Mon Sep 17 00:00:00 2001 From: Michael Vorburger Date: Tue, 19 Dec 2017 01:50:36 +0100 Subject: [PATCH] Bump error-prone from 2.1.2 to 2.1.3 and some code changes now required by enabling a few extra checks which in the first round I could not enable because of un-fixable violations in Immutables.org generated code (which could possibly have affected YANG generated code as well later) With with the new XepExcludedPaths, see https://github.com/google/error-prone/issues/821 (instead of https://github.com/google/error-prone/issues/808), we can ignore /target/ so that's not a problem, anymore. The disabled StaticOrDefaultInterfaceMethod is because I've hit it during the build of caches/ but learnt its very Android specific, we don't care, see http://errorprone.info/bugpattern/StaticOrDefaultInterfaceMethod The added FutureReturnValueIgnored is GREAT. Change Log on https://groups.google.com/forum/#!msg/error-prone-announce/-ExdzeDOURY/7cQqwSezCQAJ Change-Id: I05d5497626240d1a30cc54ee3014f1dbe367fcb5 Signed-off-by: Michael Vorburger --- .../inject/guice/testutils/AbstractCheckedModule.java | 6 ++++++ .../infrautils/inject/AbstractLifecycle.java | 2 +- .../org/opendaylight/infrautils/inject/Lifecycle.java | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/inject-guice-testutils/src/main/java/org/opendaylight/infrautils/inject/guice/testutils/AbstractCheckedModule.java b/inject-guice-testutils/src/main/java/org/opendaylight/infrautils/inject/guice/testutils/AbstractCheckedModule.java index d710c76..f16fea9 100644 --- a/inject-guice-testutils/src/main/java/org/opendaylight/infrautils/inject/guice/testutils/AbstractCheckedModule.java +++ b/inject-guice-testutils/src/main/java/org/opendaylight/infrautils/inject/guice/testutils/AbstractCheckedModule.java @@ -8,6 +8,7 @@ package org.opendaylight.infrautils.inject.guice.testutils; import com.google.inject.AbstractModule; +import com.google.inject.Binder; import org.opendaylight.infrautils.inject.ModuleSetupRuntimeException; /** @@ -19,6 +20,11 @@ */ public abstract class AbstractCheckedModule extends AbstractModule { + /** + * Configures a {@link Binder} via the exposed methods. + * + * @throws ModuleSetupRuntimeException if binding failed + */ @Override @SuppressWarnings("checkstyle:IllegalCatch") protected final void configure() throws ModuleSetupRuntimeException { diff --git a/inject/src/main/java/org/opendaylight/infrautils/inject/AbstractLifecycle.java b/inject/src/main/java/org/opendaylight/infrautils/inject/AbstractLifecycle.java index 1532cf1..3f2a4af 100644 --- a/inject/src/main/java/org/opendaylight/infrautils/inject/AbstractLifecycle.java +++ b/inject/src/main/java/org/opendaylight/infrautils/inject/AbstractLifecycle.java @@ -28,7 +28,7 @@ private enum State { STARTED, STOPPED } - private AtomicReference state = new AtomicReference<>(State.STOPPED); + private final AtomicReference state = new AtomicReference<>(State.STOPPED); protected abstract void start() throws Exception; diff --git a/inject/src/main/java/org/opendaylight/infrautils/inject/Lifecycle.java b/inject/src/main/java/org/opendaylight/infrautils/inject/Lifecycle.java index f28e08d..81a6a0a 100644 --- a/inject/src/main/java/org/opendaylight/infrautils/inject/Lifecycle.java +++ b/inject/src/main/java/org/opendaylight/infrautils/inject/Lifecycle.java @@ -18,8 +18,18 @@ */ public interface Lifecycle { + /** + * Initialize the object. + * + * @throws ModuleSetupRuntimeException if initialization failed + */ void init() throws ModuleSetupRuntimeException; + /** + * Destroy the object. + * + * @throws ModuleSetupRuntimeException if destruction failed + */ void destroy() throws ModuleSetupRuntimeException; boolean isRunning();