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

Chris Nauroth commented on HADOOP-9018:
---------------------------------------

Hi, Arpit.  Most of the patch looks good.  I downloaded it, applied it, and ran 
a subset of tests in common and HDFS.  Everything passed.

Here are a few comments:

# It looks like the {{Path#hasUriScheme}} regex is unused.
# In {{PathData#ValidateWindowsPath}}, is it OK that the logic throws an 
exception for forward slashes?  On Windows, I've seen things like "\test/data" 
work fine, at least in cmd.exe.
# In {{PathData#ValidateWindowsPath}}, can you explain the check against 
{{potentialUri}}?  Whether it matches or doesn't match, the next step is to 
return from the method, so it doesn't seem to be doing anything.
# {{TestPath#testInvalidWindowsPaths}} and 
{{TestPathData#testInvalidWindowsPath}} each test just one path, so you could 
eliminate the arrays and the loops and just test the single input.

A couple of nitpicks:

# {{IllegalArgumentException}} is unchecked, so there is no need to put it in a 
method's "throws" clause.
# Change {{PathData#ValidateWindowsPath}} to {{PathData#validateWindowsPath}}.  
(Lower-case first letter of method name.)
# In the same method, in the JavaDoc change "suppliued" to "supplied".

                
> Reject invalid Windows URIs
> ---------------------------
>
>                 Key: HADOOP-9018
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9018
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: trunk-win
>         Environment: Windows
>            Reporter: Arpit Agarwal
>            Assignee: Arpit Agarwal
>         Attachments: HADOOP-9018.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> This JIRA is to make handling of improperly constructed file URIs for Windows 
> local paths more rigorous. e.g. reject "file:///c:\\Windows" 
> Valid file URI syntax explained at 
> http://blogs.msdn.com/b/ie/archive/2006/12/06/file-uris-in-windows.aspx.
> Also see https://issues.apache.org/jira/browse/HADOOP-8953

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to