[GitHub] storm pull request #2519: STORM-2903: Fix possible NullPointerException in A...

2018-01-21 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/storm/pull/2519


---


[GitHub] storm pull request #2519: STORM-2903: Fix possible NullPointerException in A...

2018-01-19 Thread arunmahadevan
Github user arunmahadevan commented on a diff in the pull request:

https://github.com/apache/storm/pull/2519#discussion_r162705370
  
--- Diff: 
external/storm-autocreds/src/main/java/org/apache/storm/common/AbstractAutoCreds.java
 ---
@@ -215,9 +215,17 @@ private void addTokensToUGI(Subject subject) {
 if (allTokens != null) {
 for (Token token : 
allTokens) {
 try {
+
+if (token == null) {
+LOG.debug("Ignoring null token");
+continue;
+}
+
 LOG.debug("Current user: {}", 
UserGroupInformation.getCurrentUser());
-LOG.debug("Token from credential: {} / 
{}", token.toString(),
-
token.decodeIdentifier().getUser());
+LOG.debug("Token from Credentials : {}", 
token);
+
+if (token.decodeIdentifier() != null)
--- End diff --

@omkreddy , toString already handles it and just printing the token would 
take care of decoding and printing the user information.

https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/Token.java#L429


---