[ 
https://issues.apache.org/jira/browse/HADOOP-8751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446420#comment-13446420
 ] 

Vlad Rozov commented on HADOOP-8751:
------------------------------------

I don't think it is important to distinguish between null and empty fields in 
the Token class. Default constructor initializes to empty fields. For 
consistency and to avoid checks for nullness, IMHO it is easier to prevent 
fields to be null altogether.

In the TestHftpDelegationToken test case both null and empty byte arrays are 
used to initialize identifier and password.
                
> NPE in Token.toString() when Token is constructed using null identifier
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-8751
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8751
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 2.0.0-alpha
>            Reporter: Vlad Rozov
>            Assignee: Vlad Rozov
>            Priority: Minor
>             Fix For: 2.0.0-alpha
>
>         Attachments: HADOOP-8751.patch
>
>
> Token constructor allows null to be passed leading to NPE in 
> Token.toString(). Simple fix is to check for null in constructor and use 
> empty byte arrays.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to