[tor-commits] [onionoo/master] Deprecate Time and TimeFactory.
karsten at torproject.org
karsten at torproject.org
Mon Jan 9 20:11:24 UTC 2017
commit 274aa6fb53bdc7151e8e5c46c556382552fdb2cd
Author: iwakeh <iwakeh at torproject.org>
Date: Mon Jan 9 21:04:19 2017 +0100
Deprecate Time and TimeFactory.
---
src/main/java/org/torproject/onionoo/util/Time.java | 2 ++
src/main/java/org/torproject/onionoo/util/TimeFactory.java | 10 ++++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/torproject/onionoo/util/Time.java b/src/main/java/org/torproject/onionoo/util/Time.java
index 1b7e121..45c2d7b 100644
--- a/src/main/java/org/torproject/onionoo/util/Time.java
+++ b/src/main/java/org/torproject/onionoo/util/Time.java
@@ -6,6 +6,8 @@ package org.torproject.onionoo.util;
/*
* Wrapper for System.currentTimeMillis() that can be replaced with a
* custom time source for testing.
+ *
+ * @deprecated Try to use other time setting methods for testing.
*/
public class Time {
diff --git a/src/main/java/org/torproject/onionoo/util/TimeFactory.java b/src/main/java/org/torproject/onionoo/util/TimeFactory.java
index 608b595..f0c8a98 100644
--- a/src/main/java/org/torproject/onionoo/util/TimeFactory.java
+++ b/src/main/java/org/torproject/onionoo/util/TimeFactory.java
@@ -9,13 +9,19 @@ public class TimeFactory {
/** Sets a custom singleton time instance that will be returned by
* {@link #getTime} rather than creating an instance upon first
- * invocation. */
+ * invocation.
+ *
+ * @deprecated Try to use other time setting methods for testing.
+ */
public static void setTime(Time time) {
timeInstance = time;
}
/** Returns the singleton node indexer instance that gets created upon
- * first invocation of this method. */
+ * first invocation of this method.
+ *
+ * @deprecated Try to use other time setting methods for testing.
+ */
public static Time getTime() {
if (timeInstance == null) {
timeInstance = new Time();
More information about the tor-commits
mailing list