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 b519af1..7bc1352 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;
-        if(!nullOrNonPositive(duration) && threadFactory == null && nullOrNonPositive(ticksPerWheel)) {
+        if (!nullOrNonPositive(duration) && threadFactory == null && nullOrNonPositive(ticksPerWheel)) {
             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));
         }
 
-        if(nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
+        if (nullOrNonPositive(duration) && threadFactory != null && nullOrNonPositive(ticksPerWheel)) {
             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));
         }
 
-        if(!nullOrNonPositive(duration) && threadFactory != null && !nullOrNonPositive(ticksPerWheel)) {
+        if (!nullOrNonPositive(duration) && threadFactory != null && !nullOrNonPositive(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());
     }
 
-    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 6d31034..ad09341 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[] {
-                    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 893ea16..bb9761d 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
-     * via {@link EventSourceRegistration#close()}.
+     *         via {@link EventSourceRegistration#close()}.
      */
     <T extends EventSource> EventSourceRegistration<T> registerEventSource(T eventSource);
 }
index 6959912..1930e2b 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;
 
-/**
- * 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");
index 4f11c50..13f36f1 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;
 
-/**
- * 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");
index 84559d5..f328661 100644 (file)
@@ -6,10 +6,8 @@
  * 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
index 8117134..cce41da 100644 (file)
@@ -52,7 +52,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 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
@@ -60,25 +60,23 @@ import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
  */
 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 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;
 
-    /**
-     * @throws java.lang.Exception
-     */
     @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.
-        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());
@@ -152,9 +148,6 @@ public class DOMRpcServiceTestBugfix560 {
         }
     }
 
-    /**
-     * @throws java.lang.Exception
-     */
     @After
     public void teardown() {
         testContext.close();
index 9987bff..bc521d1 100644 (file)
@@ -32,7 +32,8 @@ public class MessageCapturingFlowService implements OpendaylightOfMigrationTestM
         return knockKnockResult;
     }
 
-    public MessageCapturingFlowService setKnockKnockResult(final ListenableFuture<RpcResult<KnockKnockOutput>> kkOutput) {
+    public MessageCapturingFlowService setKnockKnockResult(
+            final ListenableFuture<RpcResult<KnockKnockOutput>> kkOutput) {
         this.knockKnockResult = kkOutput;
         return this;
     }
@@ -52,12 +53,14 @@ public class MessageCapturingFlowService implements OpendaylightOfMigrationTestM
         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;
     }
 
-    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;
     }
@@ -77,6 +80,4 @@ public class MessageCapturingFlowService implements OpendaylightOfMigrationTestM
         receivedKnocks.put(input.getKnockerId(), input);
         return knockKnockResult;
     }
-
-
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.