incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject git commit: Fixing a NPE.
Date Thu, 29 Jan 2015 17:51:36 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/master b2d75ec9d -> b6000cd2b


Fixing a NPE.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/b6000cd2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/b6000cd2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/b6000cd2

Branch: refs/heads/master
Commit: b6000cd2b7cc43ffcee59fae85db02fff3c6f1be
Parents: b2d75ec
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Thu Jan 29 12:51:06 2015 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Thu Jan 29 12:51:06 2015 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/blur/concurrent/ThreadWatcher.java  | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/b6000cd2/blur-util/src/main/java/org/apache/blur/concurrent/ThreadWatcher.java
----------------------------------------------------------------------
diff --git a/blur-util/src/main/java/org/apache/blur/concurrent/ThreadWatcher.java b/blur-util/src/main/java/org/apache/blur/concurrent/ThreadWatcher.java
index df491b7..d94b17e 100644
--- a/blur-util/src/main/java/org/apache/blur/concurrent/ThreadWatcher.java
+++ b/blur-util/src/main/java/org/apache/blur/concurrent/ThreadWatcher.java
@@ -237,6 +237,10 @@ public class ThreadWatcher {
   }
 
   public static void status(String task, float complete) {
+    if (_instance == null) {
+      LOG.warn("Call to resetStatus on thread no being watched.");
+      return;
+    }
     Watch watch = _instance._threads.get(Thread.currentThread());
     if (watch == null) {
       return;
@@ -245,6 +249,10 @@ public class ThreadWatcher {
   }
 
   public static void resetStatus() {
+    if (_instance == null) {
+      LOG.warn("Call to resetStatus on thread no being watched.");
+      return;
+    }
     Watch watch = _instance._threads.get(Thread.currentThread());
     if (watch == null) {
       return;


Mime
View raw message