netty-timer-config: final parameters 73/56973/2
authorStephen Kitt <skitt@redhat.com>
Fri, 12 May 2017 15:37:49 +0000 (17:37 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Mon, 15 May 2017 11:49:54 +0000 (11:49 +0000)
This automatically-generated patch flags all appropriate parameters as
final (including caught exceptions).

Change-Id: I71a80cceb92ea77c2880d26ab311dd1c797e502d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java
opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModule.java
opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleFactory.java
opendaylight/config/netty-timer-config/src/test/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleTest.java

index 299f9be..8786f3a 100644 (file)
@@ -20,7 +20,7 @@ public final class HashedWheelTimerCloseable implements AutoCloseable, Timer {
 
     private final Timer timer;
 
-    private HashedWheelTimerCloseable(Timer timer) {
+    private HashedWheelTimerCloseable(final Timer timer) {
         this.timer = timer;
     }
 
@@ -30,7 +30,7 @@ public final class HashedWheelTimerCloseable implements AutoCloseable, Timer {
     }
 
     @Override
-    public Timeout newTimeout(TimerTask task, long delay, TimeUnit unit) {
+    public Timeout newTimeout(final TimerTask task, final long delay, final TimeUnit unit) {
         return this.timer.newTimeout(task, delay, unit);
     }
 
@@ -39,8 +39,8 @@ public final class HashedWheelTimerCloseable implements AutoCloseable, Timer {
         return this.timer.stop();
     }
 
-    public static HashedWheelTimerCloseable newInstance(@Nullable ThreadFactory threadFactory,
-            @Nullable Long duration, @Nullable Integer ticksPerWheel) {
+    public static HashedWheelTimerCloseable newInstance(@Nullable final ThreadFactory threadFactory,
+            @Nullable final Long duration, @Nullable final Integer ticksPerWheel) {
         TimeUnit unit = TimeUnit.MILLISECONDS;
         if(!nullOrNonPositive(duration) && threadFactory == null && nullOrNonPositive(ticksPerWheel)) {
             return new HashedWheelTimerCloseable(new HashedWheelTimer(duration, unit));
@@ -67,7 +67,7 @@ public final class HashedWheelTimerCloseable implements AutoCloseable, Timer {
         return new HashedWheelTimerCloseable(new HashedWheelTimer());
     }
 
-    private static boolean nullOrNonPositive(Number n) {
+    private static boolean nullOrNonPositive(final Number n) {
         return n == null || n.longValue() <= 0;
     }
 }
index 579806f..2564ef9 100644 (file)
@@ -33,14 +33,14 @@ public final class HashedWheelTimerModule extends
         org.opendaylight.controller.config.yang.netty.timer.AbstractHashedWheelTimerModule {
     private BundleContext bundleContext;
 
-    public HashedWheelTimerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
-            org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+    public HashedWheelTimerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+            final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
     }
 
-    public HashedWheelTimerModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
-            org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
-            HashedWheelTimerModule oldModule, java.lang.AutoCloseable oldInstance) {
+    public HashedWheelTimerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier,
+            final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
+            final HashedWheelTimerModule oldModule, final java.lang.AutoCloseable oldInstance) {
         super(identifier, dependencyResolver, oldModule, oldInstance);
     }
 
@@ -66,7 +66,7 @@ public final class HashedWheelTimerModule extends
 
         return Reflection.newProxy(AutoCloseableTimerInterface.class, new AbstractInvocationHandler() {
             @Override
-            protected Object handleInvocation(Object proxy, Method method, Object[] args) throws Throwable {
+            protected Object handleInvocation(final Object proxy, final Method method, final Object[] args) throws Throwable {
                 if (method.getName().equals("close")) {
                     tracker.close();
                     return null;
@@ -77,7 +77,7 @@ public final class HashedWheelTimerModule extends
         });
     }
 
-    public void setBundleContext(BundleContext bundleContext) {
+    public void setBundleContext(final BundleContext bundleContext) {
         this.bundleContext = bundleContext;
     }
 
index a4049c8..6c33790 100644 (file)
@@ -26,8 +26,8 @@ import org.osgi.framework.BundleContext;
 @Deprecated
 public class HashedWheelTimerModuleFactory extends AbstractHashedWheelTimerModuleFactory {
     @Override
-    public HashedWheelTimerModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
-            HashedWheelTimerModule oldModule, AutoCloseable oldInstance, BundleContext bundleContext) {
+    public HashedWheelTimerModule instantiateModule(final String instanceName, final DependencyResolver dependencyResolver,
+            final HashedWheelTimerModule oldModule, final AutoCloseable oldInstance, final BundleContext bundleContext) {
         HashedWheelTimerModule module = super.instantiateModule(instanceName, dependencyResolver, oldModule,
                 oldInstance, bundleContext);
         module.setBundleContext(bundleContext);
@@ -35,8 +35,8 @@ public class HashedWheelTimerModuleFactory extends AbstractHashedWheelTimerModul
     }
 
     @Override
-    public HashedWheelTimerModule instantiateModule(String instanceName, DependencyResolver dependencyResolver,
-            BundleContext bundleContext) {
+    public HashedWheelTimerModule instantiateModule(final String instanceName, final DependencyResolver dependencyResolver,
+            final BundleContext bundleContext) {
         HashedWheelTimerModule module = super.instantiateModule(instanceName, dependencyResolver, bundleContext);
         module.setBundleContext(bundleContext);
         return module;
index 9936823..87d621f 100644 (file)
@@ -61,7 +61,7 @@ public class HashedWheelTimerModuleTest extends AbstractConfigTest {
             createInstance(transaction, instanceName, 0L, 10, true);
             transaction.validateConfig();
             fail();
-        } catch (ValidationException e) {
+        } catch (final ValidationException e) {
             assertTrue(e.getMessage().contains("TickDuration value must be greater than 0"));
         }
     }
@@ -72,7 +72,7 @@ public class HashedWheelTimerModuleTest extends AbstractConfigTest {
             createInstance(transaction, instanceName, 500L, 0, true);
             transaction.validateConfig();
             fail();
-        } catch (ValidationException e) {
+        } catch (final ValidationException e) {
             assertTrue(e.getMessage().contains("TicksPerWheel value must be greater than 0"));
         }
     }

©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.