[
https://issues.apache.org/jira/browse/HADOOP-6796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12874719#action_12874719
]
Rodrigo Schmidt commented on HADOOP-6796:
-----------------------------------------
I'm not worried about my test. I fixed it by using a complete FileStatus object.
I just don't like the idea of leaving the code the way it is. It looks buggy
and next time someone bumps into the NPE error, he or she will create a JIRA
and go through all this discussion again.
@Eli: Here are a couple of options that I thought about this morning. Let me
know if they sound plausible to you:
1) Prevent srcPath from being null in any non-default constructor of
FileStatus() by using asserts. For the default constructor, use Path("/").
or
2) If srcPath is null, prevent any calls to methods different from readFields()
with asserts. (This will have some performance impact and will be hard to
maintain).
> FileStatus allows null srcPath but crashes if that's done
> ---------------------------------------------------------
>
> Key: HADOOP-6796
> URL: https://issues.apache.org/jira/browse/HADOOP-6796
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 0.22.0
> Reporter: Rodrigo Schmidt
> Assignee: Rodrigo Schmidt
> Priority: Minor
> Fix For: 0.22.0
>
> Attachments: HADOOP-6796.patch
>
>
> FileStatus allows constructor invocation with a null srcPath but many methods
> like write, readFields, compareTo, equals, and hashCode depend on this
> property.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.