accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [3/6] accumulo git commit: ACCUMULO-4444: added check for null token in ConnectorImpl
Date Fri, 16 Sep 2016 17:13:26 GMT
ACCUMULO-4444: added check for null token in ConnectorImpl

Closes apache/accumulo#153

Signed-off-by: Josh Elser <elserj@apache.org>


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

Branch: refs/heads/master
Commit: e07f6858e54b2fefab89305e24e14546fde592aa
Parents: 896aa4a
Author: Mike Miller <michaelpmiller@gmail.com>
Authored: Thu Sep 15 14:43:33 2016 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Fri Sep 16 12:18:33 2016 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/core/client/impl/ConnectorImpl.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/e07f6858/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
index 443e548..fc4affb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
@@ -55,7 +55,9 @@ public class ConnectorImpl extends Connector {
   private ReplicationOperations replicationops = null;
 
   public ConnectorImpl(final ClientContext context) throws AccumuloException, AccumuloSecurityException
{
-    checkArgument(context != null, "context is null");
+    checkArgument(context != null, "Context is null");
+    checkArgument(context.getCredentials() != null, "Credentials are null");
+    checkArgument(context.getCredentials().getToken() != null, "Authentication token is null");
     if (context.getCredentials().getToken().isDestroyed())
       throw new AccumuloSecurityException(context.getCredentials().getPrincipal(), SecurityErrorCode.TOKEN_EXPIRED);
 


Mime
View raw message