[
https://issues.apache.org/jira/browse/HADOOP-8751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14553806#comment-14553806
]
Akira AJISAKA commented on HADOOP-8751:
---------------------------------------
Thanks [~kanaka] for taking this issue. Mostly looks good to me. Two comments:
1. For Token.addBinaryBuffer, we can drop null check for {{bytes}} since the
variable is guaranteed to be non null.
{code}
+ assertEquals(token1, token2);
+ assertEquals(token1.toString(), token2.toString());
+ assertEquals(token1.encodeToUrlString(), token2.encodeToUrlString());
{code}
2. I'm thinking comparing {{Token.toString()}} is redundant and can be removed.
> 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: kanaka kumar avvaru
> Priority: Minor
> Labels: BB2015-05-TBR
> Attachments: HADOOP-8751-01.patch, HADOOP-8751-01.patch,
> HADOOP-8751-02.patch, 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 was sent by Atlassian JIRA
(v6.3.4#6332)