[
https://issues.apache.org/jira/browse/ACCUMULO-2854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14030837#comment-14030837
]
Jeffrey S Schwartz commented on ACCUMULO-2854:
----------------------------------------------
[~mdrob] - I thought about removing the second null check. The reason I left
it in is that I do not know the author of the Path class. While highly
unlikely, it is possible that toString() can return a null, which would still
leave a NPE in the code. With that in mind, I left the check in because the
code to create a new bulk import directory is probably not a performance
sensitive operation (especially compared to the actual bulk import) and the
extra line of defense seemed warranted.
That being said, I have absolutely no problem removing it.
Let me know your thoughts and I'll take care of it.
Sincerely,
Jeff Schwartz
> Bad null check in BulkImport.createNewBulkDir()
> -----------------------------------------------
>
> Key: ACCUMULO-2854
> URL: https://issues.apache.org/jira/browse/ACCUMULO-2854
> Project: Accumulo
> Issue Type: Bug
> Components: master
> Affects Versions: 1.6.0
> Reporter: Bill Havanki
> Assignee: Jeffrey S Schwartz
> Labels: newbie, summit2014
> Fix For: 1.6.1
>
> Attachments: ACCUMULO-2854.patch.txt
>
>
> At the beginning of {{createNewBulkDir}} in
> {{o.a.a.master.tableOps.BulkImport}}:
> {code}
> String tableDir = fs.matchingFileSystem(new Path(sourceDir),
> ServerConstants.getTablesDirs()).toString();
>
> if (tableDir == null)
> throw new IllegalStateException(sourceDir + " is not in a known
> namespace");
> {code}
> The call to {{matchingFileSystem()}} can return null, and if it does, a
> NullPointerException will be thrown. {{toString()}} on a non-null result will
> not return null, so the null check has no effect.
--
This message was sent by Atlassian JIRA
(v6.2#6252)