[
https://issues.apache.org/jira/browse/HADOOP-8709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436821#comment-13436821
]
Jason Lowe commented on HADOOP-8709:
------------------------------------
I wasn't proposing to revert HADOOP-6201, but even if we propose to just change
the javadoc there's still an inconsistency in the code. Currently a path
without a glob pattern returns null if nothing matches, while a path with a
glob a pattern that doesn't match anything throws FNFE. Seems like either we
should match the old behavior or at least throw FNFE in both cases, depending
upon which way we want to go.
Personally I'd rather not break compatibility unless there's a very compelling
reason to do so. The directory listing case was a clear reason to do so, and I
can see HADOOP-6201's thinking that we should match that new behavior and also
Java's convention. But I'm on the fence if that's enough reason to break
compatibility here as well. I'm not aware of a Java convention for file
globbing behavior. Globbing is like pattern matching, and I don't believe
pattern matchers normally throw when they fail to match.
> globStatus changed behavior from 0.20/1.x
> -----------------------------------------
>
> Key: HADOOP-8709
> URL: https://issues.apache.org/jira/browse/HADOOP-8709
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 0.23.0, 2.0.0-alpha
> Reporter: Jason Lowe
> Assignee: Jason Lowe
> Priority: Critical
>
> In 0.20 or 1.x, globStatus will return an empty array if the glob pattern
> does not match any files. After HADOOP-6201 it throws FileNotFoundException.
> The javadoc states it will return an empty array.
--
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