hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eli Collins (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-6796) FileStatus allows null srcPath but crashes if that's done
Date Wed, 02 Jun 2010 03:17:41 GMT

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

Eli Collins commented on HADOOP-6796:
-------------------------------------

You could also modify Path to accept Path("") or Path(null) so that instead of throwing an
exception they silently convert to Path("/"). That runs into the same rationale, ie it's useful
that Path throws an exception when given invalid arguments instead of converting the path
to something else (this way people know when they pass in a null by mistake).  You could also
make sure FileStatus objects are created via a method that sets the required fields (ie use
a factory).

What's the code that triggers this? If that code just wants a FileStatus that represents "/"
then could you just modify that code to set the path explicitly to "/"?

> 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.


Mime
View raw message