From 44f8154f071fc387d6a094ba2227c9e35319f74c Mon Sep 17 00:00:00 2001 From: dev <dev@robertfoss.se> Date: Wed, 8 Apr 2015 17:47:27 +0000 Subject: [PATCH] #1069: Improved patch according to ticket feedback --- core/java/src/net/i2p/util/SimpleScheduler.java | 6 +++--- core/java/src/net/i2p/util/SimpleTimer2.java | 14 +++----------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/core/java/src/net/i2p/util/SimpleScheduler.java b/core/java/src/net/i2p/util/SimpleScheduler.java index 1cea34298b..4315363328 100644 --- a/core/java/src/net/i2p/util/SimpleScheduler.java +++ b/core/java/src/net/i2p/util/SimpleScheduler.java @@ -30,7 +30,7 @@ public class SimpleScheduler { /** * If you have a context, use context.simpleScheduler() instead - * @deprecated in 0.9.19 + * @deprecated in 0.9.20, replaced by SimpleTimer2 */ public static SimpleScheduler getInstance() { return I2PAppContext.getGlobalContext().simpleScheduler(); @@ -47,7 +47,7 @@ public class SimpleScheduler { /** * To be instantiated by the context. * Others should use context.simpleTimer() instead - * @deprecated in 0.9.19 + * @deprecated in 0.9.20, replaced by SimpleTimer2 */ public SimpleScheduler(I2PAppContext context) { this(context, "SimpleScheduler"); @@ -56,7 +56,7 @@ public class SimpleScheduler { /** * To be instantiated by the context. * Others should use context.simpleTimer() instead - * @deprecated in 0.9.19 + * @deprecated in 0.9.20, replaced by SimpleTimer2 */ private SimpleScheduler(I2PAppContext context, String name) { _log = context.logManager().getLog(SimpleScheduler.class); diff --git a/core/java/src/net/i2p/util/SimpleTimer2.java b/core/java/src/net/i2p/util/SimpleTimer2.java index 497eed6d41..8d2a0cddf8 100644 --- a/core/java/src/net/i2p/util/SimpleTimer2.java +++ b/core/java/src/net/i2p/util/SimpleTimer2.java @@ -151,12 +151,13 @@ public class SimpleTimer2 { * subsequent executions (unlike SimpleTimer, where the TimedEvent does * its own rescheduling). * + * @since 0.9.20 * @param delay run the first iteration of this event after delay ms * @param timeoutMs run subsequent iterations of this event every timeoutMs ms */ public void addPeriodicEvent(final SimpleTimer.TimedEvent event, final long timeoutMs) { - new PeriodicTimedEvent(SimpleTimer2.getInstance(), timeoutMs) { + new PeriodicTimedEvent(SimpleTimer2.getInstance(), timeoutMs, timeoutMs) { @Override public void timeReached() { event.timeReached(); @@ -172,6 +173,7 @@ public class SimpleTimer2 { * subsequent executions (unlike SimpleTimer, where the TimedEvent does * its own rescheduling). * + * @since 0.9.20 * @param delay run the first iteration of this event after delay ms * @param timeoutMs run subsequent iterations of this event every timeoutMs ms */ @@ -467,16 +469,6 @@ public class SimpleTimer2 { public static abstract class PeriodicTimedEvent extends TimedEvent { private long _timeoutMs; - /** - * Schedule periodic event - * - * @param timeoutMs run subsequent iterations of this event every timeoutMs ms - */ - public PeriodicTimedEvent(SimpleTimer2 pool, long timeoutMs) { - super(pool, timeoutMs); - _timeoutMs = timeoutMs; - } - /** * Schedule periodic event * -- GitLab