harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao Shu (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6573) [classlib][luni] Can't load classes with file://// and URL class
Date Fri, 09 Jul 2010 06:22:49 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886633#action_12886633
] 

Xiao Shu commented on HARMONY-6573:
-----------------------------------

According to RFC 3986: Uniform Resource Identifiers (URI): Generic Syntax,

URI         = scheme ":" hier-part [ "?" query ] [ "#" fragment ]

      hier-part   = "//" authority path-abempty
                  / path-absolute
                  / path-rootless
                  / path-empty

   The scheme and path components are required, though the path may be
   empty (no characters).  When authority is present, the path must
   either be empty or begin with a slash ("/") character.  When
   authority is not present, the path cannot begin with two slash
   characters ("//"). 

So if there are more than three slashes after ':', authority should be taken as null, 

> [classlib][luni] Can't load classes with file://// and URL class
> ----------------------------------------------------------------
>
>                 Key: HARMONY-6573
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6573
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M14
>            Reporter: Xiao Shu
>            Priority: Minor
>
> Run below test case,
> import java.net.MalformedURLException;
> import java.net.URL;
> public class Test {  
>     public static void main(String args[]) throws MalformedURLException {
>         URL url1 = new URL("file:////home/test.jar");
>         System.out.println("getAuthority:" + url1.getAuthority());        
>         System.out.println("getFile:" + url1.getFile());
>     }
> }
> The output of harmony is:
> getAuthority:
> getFile://home/test.jar
> while the output of Sun RI is:
> getAuthority:null
> getFile:////home/test.jar

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