Another round of checkstyle fixes 46/83846/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Aug 2019 09:40:15 +0000 (11:40 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Aug 2019 10:35:34 +0000 (12:35 +0200)
This fixes failures reported by upgraded checkstyle, as well as
some non-enforced violations.

Change-Id: I8b6a9667c6586bef528587d455f7a8597b4f483f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java
opendaylight/md-sal/mdsal-it-base/src/main/java/org/opendaylight/controller/mdsal/it/base/AbstractMdsalTestBase.java
opendaylight/md-sal/messagebus-spi/src/main/java/org/opendaylight/controller/messagebus/spi/EventSourceRegistry.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/ConcurrentImplicitCreateTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/md/sal/binding/data/WildcardedDataChangeListenerTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/package-info.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/DOMRpcServiceTestBugfix560.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/MessageCapturingFlowService.java

index b519af1b99581306e7d5418bd2de820db5659ef1..7bc13521642cb8475e505dcefe1a339ffd69463e 100644 (file)
@@ -47,24 +47,24 @@ public final class HashedWheelTimerCloseable implements AutoCloseable, Timer {
     public static HashedWheelTimerCloseable newInstance(final @Nullable ThreadFactory threadFactory,
             final @Nullable Long duration, final @Nullable Integer ticksPerWheel) {
         TimeUnit unit = TimeUnit.MILLISECONDS;
     public static HashedWheelTimerCloseable newInstance(final @Nullable ThreadFactory threadFactory,
             final @Nullable Long duration, final @Nullable Integer ticksPerWheel) {
         TimeUnit unit = TimeUnit.MILLISECONDS;
-        if(!nullOrNonPositive(duration) && threadFactory == null && nullOrNonPositive(ticksPerWheel)) {
+        if (!nullOrNonPositive(duration) && threadFactory == null && nullOrNonPositive(ticksPerWheel)) {
             return new HashedWheelTimerCloseable(new HashedWheelTimer(duration, unit));
         }
 
             return new HashedWheelTimerCloseable(new HashedWheelTimer(duration, unit));
         }
 
-        if(!nullOrNonPositive(duration) && threadFactory == null && !nullOrNonPositive(ticksPerWheel)) {
+        if (!nullOrNonPositive(duration) && threadFactory == null && !nullOrNonPositive(ticksPerWheel)) {
             return new HashedWheelTimerCloseable(new HashedWheelTimer(duration, unit, ticksPerWheel));
         }
 
             return new HashedWheelTimerCloseable(new HashedWheelTimer(duration, unit, ticksPerWheel));
         }
 
-        if(nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
+        if (nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
             return new HashedWheelTimerCloseable(new HashedWheelTimer(threadFactory));
         }
 
             return new HashedWheelTimerCloseable(new HashedWheelTimer(threadFactory));
         }
 
-        if(!nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
+        if (!nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
             return new HashedWheelTimerCloseable(
                     new HashedWheelTimer(threadFactory, duration, unit));
         }
 
             return new HashedWheelTimerCloseable(
                     new HashedWheelTimer(threadFactory, duration, unit));
         }
 
-        if(!nullOrNonPositive(duration) && threadFactory != null && !nullOrNonPositive(ticksPerWheel)) {
+        if (!nullOrNonPositive(duration) && threadFactory != null && !nullOrNonPositive(ticksPerWheel)) {
             return new HashedWheelTimerCloseable(
                     new HashedWheelTimer(threadFactory, duration, unit, ticksPerWheel));
         }
             return new HashedWheelTimerCloseable(
                     new HashedWheelTimer(threadFactory, duration, unit, ticksPerWheel));
         }
@@ -72,7 +72,7 @@ public final class HashedWheelTimerCloseable implements AutoCloseable, Timer {
         return new HashedWheelTimerCloseable(new HashedWheelTimer());
     }
 
         return new HashedWheelTimerCloseable(new HashedWheelTimer());
     }
 
-    private static boolean nullOrNonPositive(final Number n) {
-        return n == null || n.longValue() <= 0;
+    private static boolean nullOrNonPositive(final Number num) {
+        return num == null || num.longValue() <= 0;
     }
 }
     }
 }
index 6d31034d8faaf097ac0f3c95f0171133123d1c90..ad0934122dd565f200344760110b88ea4676d30c 100644 (file)
@@ -139,30 +139,30 @@ public abstract class AbstractMdsalTestBase {
             final String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf.features",
                 "org.apache.karaf.features.core");
             options = OptionUtils.combine(options, new VMOption[] {
             final String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf.features",
                 "org.apache.karaf.features.core");
             options = OptionUtils.combine(options, new VMOption[] {
-                    new VMOption("--add-reads=java.xml=java.logging"),
-                    new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
-                    new VMOption("--patch-module"),
-                    new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-" + karafVersion + ".jar"),
-                    new VMOption("--patch-module"),
-                    new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-" + karafVersion + ".jar"),
-                    new VMOption("--add-opens"),
-                    new VMOption("java.base/java.security=ALL-UNNAMED"),
-                    new VMOption("--add-opens"),
-                    new VMOption("java.base/java.net=ALL-UNNAMED"),
-                    new VMOption("--add-opens"),
-                    new VMOption("java.base/java.lang=ALL-UNNAMED"),
-                    new VMOption("--add-opens"),
-                    new VMOption("java.base/java.util=ALL-UNNAMED"),
-                    new VMOption("--add-opens"),
-                    new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
-                    new VMOption("--add-opens"),
-                    new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
-                    new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
-                    new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
-                    new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
-                    new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
-                    new VMOption("-classpath"),
-                    new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
+                new VMOption("--add-reads=java.xml=java.logging"),
+                new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
+                new VMOption("--patch-module"),
+                new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-" + karafVersion + ".jar"),
+                new VMOption("--patch-module"),
+                new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-" + karafVersion + ".jar"),
+                new VMOption("--add-opens"),
+                new VMOption("java.base/java.security=ALL-UNNAMED"),
+                new VMOption("--add-opens"),
+                new VMOption("java.base/java.net=ALL-UNNAMED"),
+                new VMOption("--add-opens"),
+                new VMOption("java.base/java.lang=ALL-UNNAMED"),
+                new VMOption("--add-opens"),
+                new VMOption("java.base/java.util=ALL-UNNAMED"),
+                new VMOption("--add-opens"),
+                new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
+                new VMOption("--add-opens"),
+                new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
+                new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
+                new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
+                new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
+                new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
+                new VMOption("-classpath"),
+                new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
             });
         }
 
             });
         }
 
index 893ea16940370a55dce46e0ed5947040bea25876..bb9761d1ae559d990728441e12fcce41e6c5dd05 100644 (file)
@@ -18,7 +18,7 @@ public interface EventSourceRegistry extends AutoCloseable {
      *
      * @param eventSource the EventSource instance to register
      * @return an EventSourceRegistration instance that is used to unregister the EventSource
      *
      * @param eventSource the EventSource instance to register
      * @return an EventSourceRegistration instance that is used to unregister the EventSource
-     * via {@link EventSourceRegistration#close()}.
+     *         via {@link EventSourceRegistration#close()}.
      */
     <T extends EventSource> EventSourceRegistration<T> registerEventSource(T eventSource);
 }
      */
     <T extends EventSource> EventSourceRegistration<T> registerEventSource(T eventSource);
 }
index 6959912d36b4e4a46d453d661c21750bcb96d7ce..1930e2b4c943574ae2e0d481eefbf4cfc7ef7c70 100644 (file)
@@ -21,9 +21,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controll
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.list.rev140701.two.level.list.TopLevelListKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
-/**
- * FIXME: THis test should be moved to sal-binding-broker and rewritten to use new DataBroker API
- */
+// FIXME: THis test should be moved to sal-binding-broker and rewritten to use new DataBroker API
 public class ConcurrentImplicitCreateTest extends AbstractDataServiceTest {
 
     private static final TopLevelListKey FOO_KEY = new TopLevelListKey("foo");
 public class ConcurrentImplicitCreateTest extends AbstractDataServiceTest {
 
     private static final TopLevelListKey FOO_KEY = new TopLevelListKey("foo");
index 4f11c50e53ddd656749afd6e4913395ec5431ee7..13f36f172173da436c0539999660419aace0a37f 100644 (file)
@@ -35,9 +35,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controll
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
 
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
 
-/**
- * FIXME: THis test should be moved to compat test-suite
- */
+// FIXME: This test should be moved to compat test-suite
 public class WildcardedDataChangeListenerTest extends AbstractDataTreeChangeListenerTest {
 
     private static final TopLevelListKey TOP_LEVEL_LIST_0_KEY = new TopLevelListKey("test:0");
 public class WildcardedDataChangeListenerTest extends AbstractDataTreeChangeListenerTest {
 
     private static final TopLevelListKey TOP_LEVEL_LIST_0_KEY = new TopLevelListKey("test:0");
index 84559d506b400017f84d770f4743d42e5d7ac561..f328661477c3fb35296bbb85bbd324a8c810f868 100644 (file)
@@ -6,10 +6,8 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 /**
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 /**
- * This testsuite test Hydrogen-level API and regression for most of it,
- *
- * FIXME: this testsuite needs to be refactored to use new DataBroker API,
- * moved to sal-binding-broker-impl and uses models only from sal-test-model.
- *
+ * This testsuite test Hydrogen-level API and regression for most of it.
  */
  */
+// FIXME: this testsuite needs to be refactored to use new DataBroker API,  moved to sal-binding-broker-impl
+// and uses models only from sal-test-model.
 package org.opendaylight.controller.sal.binding.test.bugfix;
\ No newline at end of file
 package org.opendaylight.controller.sal.binding.test.bugfix;
\ No newline at end of file
index 81171349d739d75cf4f1e12e5317618896565fa9..cce41da2d72df1fb5625667fa0c5af8e330752ef 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 /**
 import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
 
 /**
- * Test case for reported bug 560
+ * Test case for reported bug 560.
  *
  * @author Lukas Sedlak
  * @see <a
  *
  * @author Lukas Sedlak
  * @see <a
@@ -60,25 +60,23 @@ import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
  */
 public class DOMRpcServiceTestBugfix560 {
 
  */
 public class DOMRpcServiceTestBugfix560 {
 
-    private final static String RPC_SERVICE_NAMESPACE = "urn:opendaylight:params:xml:ns:yang:controller:md:sal:test:bi:ba:rpcservice";
-    private final static String REVISION_DATE = "2014-07-01";
-    private final static QName RPC_NAME = QName.create(RPC_SERVICE_NAMESPACE,
-            REVISION_DATE, "rock-the-house");
+    private static final String RPC_SERVICE_NAMESPACE =
+            "urn:opendaylight:params:xml:ns:yang:controller:md:sal:test:bi:ba:rpcservice";
+    private static final String REVISION_DATE = "2014-07-01";
+    private static final QName RPC_NAME = QName.create(RPC_SERVICE_NAMESPACE, REVISION_DATE, "rock-the-house");
 
     private static final String TLL_NAME = "id";
     private static final QName TLL_NAME_QNAME = QName.create(TopLevelList.QNAME, "name");
 
     private static final InstanceIdentifier<TopLevelList> BA_MOUNT_ID = createBATllIdentifier(TLL_NAME);
 
     private static final String TLL_NAME = "id";
     private static final QName TLL_NAME_QNAME = QName.create(TopLevelList.QNAME, "name");
 
     private static final InstanceIdentifier<TopLevelList> BA_MOUNT_ID = createBATllIdentifier(TLL_NAME);
-    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_MOUNT_ID = createBITllIdentifier(TLL_NAME);
+    private static final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier BI_MOUNT_ID =
+            createBITllIdentifier(TLL_NAME);
 
     private BindingTestContext testContext;
     private DOMMountPointService domMountPointService;
     private MountPointService bindingMountPointService;
     private SchemaContext schemaContext;
 
 
     private BindingTestContext testContext;
     private DOMMountPointService domMountPointService;
     private MountPointService bindingMountPointService;
     private SchemaContext schemaContext;
 
-    /**
-     * @throws java.lang.Exception
-     */
     @Before
     public void setUp() throws Exception {
         final BindingBrokerTestFactory testFactory = new BindingBrokerTestFactory();
     @Before
     public void setUp() throws Exception {
         final BindingBrokerTestFactory testFactory = new BindingBrokerTestFactory();
@@ -118,21 +116,19 @@ public class DOMRpcServiceTestBugfix560 {
     @Test
     public void test() throws ExecutionException, InterruptedException {
         // FIXME: This is made to only make sure instance identifier codec for path is instantiated.
     @Test
     public void test() throws ExecutionException, InterruptedException {
         // FIXME: This is made to only make sure instance identifier codec for path is instantiated.
-        domMountPointService
-                .createMountPoint(BI_MOUNT_ID).addService(DOMRpcService.class, new DOMRpcService() {
-
-                    @Override
-                    public <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(final T arg0) {
-                        // TODO Auto-generated method stub
-                        return null;
-                    }
-
-                    @Override
-                    public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath arg0, final NormalizedNode<?, ?> arg1) {
-                        final DOMRpcResult result = new DefaultDOMRpcResult((NormalizedNode<?, ?>) null);
-                        return Futures.immediateCheckedFuture(result);
-                    }
-                }).register();
+        domMountPointService.createMountPoint(BI_MOUNT_ID).addService(DOMRpcService.class, new DOMRpcService() {
+            @Override
+            public <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(final T arg0) {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath arg0,
+                    final NormalizedNode<?, ?> arg1) {
+                return Futures.immediateCheckedFuture(new DefaultDOMRpcResult((NormalizedNode<?, ?>) null));
+            }
+        }).register();
 
         final Optional<MountPoint> mountInstance = bindingMountPointService.getMountPoint(BA_MOUNT_ID);
         assertTrue(mountInstance.isPresent());
 
         final Optional<MountPoint> mountInstance = bindingMountPointService.getMountPoint(BA_MOUNT_ID);
         assertTrue(mountInstance.isPresent());
@@ -152,9 +148,6 @@ public class DOMRpcServiceTestBugfix560 {
         }
     }
 
         }
     }
 
-    /**
-     * @throws java.lang.Exception
-     */
     @After
     public void teardown() {
         testContext.close();
     @After
     public void teardown() {
         testContext.close();
index 9987bffda1ed3c6eedfb3cd0ac5ef4fd4e5db67d..bc521d1254fd4020b75986d336a2bc8346c084ec 100644 (file)
@@ -32,7 +32,8 @@ public class MessageCapturingFlowService implements OpendaylightOfMigrationTestM
         return knockKnockResult;
     }
 
         return knockKnockResult;
     }
 
-    public MessageCapturingFlowService setKnockKnockResult(final ListenableFuture<RpcResult<KnockKnockOutput>> kkOutput) {
+    public MessageCapturingFlowService setKnockKnockResult(
+            final ListenableFuture<RpcResult<KnockKnockOutput>> kkOutput) {
         this.knockKnockResult = kkOutput;
         return this;
     }
         this.knockKnockResult = kkOutput;
         return this;
     }
@@ -52,12 +53,14 @@ public class MessageCapturingFlowService implements OpendaylightOfMigrationTestM
         registration.close();
     }
 
         registration.close();
     }
 
-    public MessageCapturingFlowService registerPath(final Class<? extends BaseIdentity> context, final InstanceIdentifier<?> path) {
+    public MessageCapturingFlowService registerPath(final Class<? extends BaseIdentity> context,
+            final InstanceIdentifier<?> path) {
         registration.registerPath(context, path);
         return this;
     }
 
         registration.registerPath(context, path);
         return this;
     }
 
-    public MessageCapturingFlowService unregisterPath(final Class<? extends BaseIdentity> context, final InstanceIdentifier<?> path) {
+    public MessageCapturingFlowService unregisterPath(final Class<? extends BaseIdentity> context,
+            final InstanceIdentifier<?> path) {
         registration.unregisterPath(context, path);
         return this;
     }
         registration.unregisterPath(context, path);
         return this;
     }
@@ -77,6 +80,4 @@ public class MessageCapturingFlowService implements OpendaylightOfMigrationTestM
         receivedKnocks.put(input.getKnockerId(), input);
         return knockKnockResult;
     }
         receivedKnocks.put(input.getKnockerId(), input);
         return knockKnockResult;
     }
-
-
 }
 }