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 299f9be27aa5b830cb9758e405f0273a0a5f95b5..8786f3af0a177a0068196f31bc352248f7e51da5 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 579806f804368411138030f33042165d568cb6ed..2564ef94fae8af20ebd0e123eed73f9ba51d0476 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 a4049c89e67f6f124dc5bbbb6ff0aa67bc9a9b01..6c337904cc0a3f9a2ffb38ada4dadb82ef31c34a 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 99368239737b3995e931b895a73eaa109f8b3f7d..87d621f181d96ff85bbe168f069559919b18ca06 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"));
         }
     }