Fixing uncaught exception handler and adding a test.
Change-Id: I0861b0200bb39a14c39746ae7b72a1e21f957e35
diff --git a/utils/misc/src/main/java/org/onlab/util/Tools.java b/utils/misc/src/main/java/org/onlab/util/Tools.java
index 533563b..e3a3a41 100644
--- a/utils/misc/src/main/java/org/onlab/util/Tools.java
+++ b/utils/misc/src/main/java/org/onlab/util/Tools.java
@@ -18,7 +18,6 @@
import com.google.common.base.Strings;
import com.google.common.primitives.UnsignedLongs;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
-
import org.slf4j.Logger;
import java.io.BufferedReader;
@@ -64,8 +63,8 @@
public static ThreadFactory namedThreads(String pattern) {
return new ThreadFactoryBuilder()
.setNameFormat(pattern)
- // FIXME remove UncaughtExceptionHandler before release
- .setUncaughtExceptionHandler((t, e) -> log.error("Uncaught exception on {}", t.getName(), e)).build();
+ .setUncaughtExceptionHandler((t, e) -> log.error("Uncaught exception on " + t.getName(), e))
+ .build();
}
/**
@@ -84,8 +83,8 @@
return new ThreadFactoryBuilder()
.setThreadFactory(groupedThreadFactory(groupName))
.setNameFormat(groupName.replace(GroupedThreadFactory.DELIMITER, "-") + "-" + pattern)
- // FIXME remove UncaughtExceptionHandler before release
- .setUncaughtExceptionHandler((t, e) -> log.error("Uncaught exception on {}", t.getName(), e)).build();
+ .setUncaughtExceptionHandler((t, e) -> log.error("Uncaught exception on " + t.getName(), e))
+ .build();
}
/**
@@ -242,6 +241,7 @@
/**
* Returns a human friendly time ago string for a specified system time.
+ *
* @param unixTime system time in millis
* @return human friendly time ago
*/