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

Eli Collins commented on HADOOP-8174:
-------------------------------------

The confusion is because there are two separate perspectives:

# Whether a *path* is absolute (ie the reference is non-relative, starts with 
the root). Ie /foo is an absolute path.
# Whether a *URI* is absolute (ie 
[URI#isAbsolute|http://docs.oracle.com/javase/6/docs/api/java/net/URI.html#isAbsolute()]
 where "A URI is absolute if, and only if, it has a scheme component"). Ie 
"/foo" is not absolute URI, but file:///foo is.

Because Hadoop Paths are represented by, and are just thin wrappers around, 
URIs (which is goofy!) there is some ambiguity. 

Given that the intent of Path#isAbsolute is #1 (the class-level javadoc states 
"A path string is absolute if it begins with a slash.") I think we should 
update the Path#isAbsolute javadoc to indicate this. It's also worth putting 
the above discussion in a class-level comment since it's not clear that we 
intend Path to be a file system path in most cases.
                
> Remove confusing comment in Path#isAbsolute()
> ---------------------------------------------
>
>                 Key: HADOOP-8174
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8174
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 0.23.0
>            Reporter: Suresh Srinivas
>            Assignee: Sanjay Radia
>             Fix For: 0.24.0
>
>
> The method is checking for absolute path correctly. When scheme and authority 
> are present, the path is absolute. So the following comment needs to be 
> removed.
> {noformat}
>   /**
>    * There is some ambiguity here. An absolute path is a slash
>    * relative name without a scheme or an authority.
>    * So either this method was incorrectly named or its
>    * implementation is incorrect. This method returns true
>    * even if there is a scheme and authority.
>    */
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to