From 71f19bb6cdb8fcbeec5bcb1e5258fa5c98a41085 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 12 May 2017 17:37:49 +0200 Subject: [PATCH] netty-timer-config: final parameters This automatically-generated patch flags all appropriate parameters as final (including caught exceptions). Change-Id: I71a80cceb92ea77c2880d26ab311dd1c797e502d Signed-off-by: Stephen Kitt --- .../netty/timer/HashedWheelTimerCloseable.java | 10 +++++----- .../yang/netty/timer/HashedWheelTimerModule.java | 14 +++++++------- .../netty/timer/HashedWheelTimerModuleFactory.java | 8 ++++---- .../netty/timer/HashedWheelTimerModuleTest.java | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java b/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java index 299f9be27a..8786f3af0a 100644 --- a/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java +++ b/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerCloseable.java @@ -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; } } diff --git a/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModule.java b/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModule.java index 579806f804..2564ef94fa 100644 --- a/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModule.java +++ b/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModule.java @@ -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; } diff --git a/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleFactory.java b/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleFactory.java index a4049c89e6..6c337904cc 100644 --- a/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleFactory.java +++ b/opendaylight/config/netty-timer-config/src/main/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleFactory.java @@ -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; diff --git a/opendaylight/config/netty-timer-config/src/test/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleTest.java b/opendaylight/config/netty-timer-config/src/test/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleTest.java index 9936823973..87d621f181 100644 --- a/opendaylight/config/netty-timer-config/src/test/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleTest.java +++ b/opendaylight/config/netty-timer-config/src/test/java/org/opendaylight/controller/config/yang/netty/timer/HashedWheelTimerModuleTest.java @@ -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")); } } -- 2.36.6