accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [1/6] accumulo git commit: ACCUMULO-3857 Fix possible null pointer dereference
Date Wed, 27 May 2015 20:29:26 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.6 de2763e47 -> d5e26b5dd
  refs/heads/1.7 caef59e4a -> f6ba154f2
  refs/heads/master 650f1f9fe -> 535e2f357


ACCUMULO-3857 Fix possible null pointer dereference


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

Branch: refs/heads/1.6
Commit: d5e26b5dd7d7e4c7dcf332b27fc5149f833899c6
Parents: de2763e
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Wed May 27 15:56:33 2015 -0400
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Wed May 27 16:05:15 2015 -0400

----------------------------------------------------------------------
 .../apache/accumulo/tserver/TabletServer.java   | 21 ++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d5e26b5d/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 4de42a7..c502166 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -771,8 +771,25 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
       if (state.get() == CANCELED)
         throw new CancellationException();
 
-      if (localRQ == null && state.get() == ADDED)
-        throw new IllegalStateException("Tried to get result twice");
+      if (localRQ == null) {
+        int st = state.get();
+        String stateStr;
+        switch (st) {
+          case ADDED:
+            stateStr = "ADDED";
+            break;
+          case CANCELED:
+            stateStr = "CANCELED";
+            break;
+          case INITIAL:
+            stateStr = "INITIAL";
+            break;
+          default:
+            stateStr = "UNKNOWN";
+            break;
+        }
+        throw new IllegalStateException("Tried to get result twice [state=" + stateStr +
"(" + st + ")]");
+      }
 
       Object r = localRQ.poll(timeout, unit);
 


Mime
View raw message