You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Spark Shen <sm...@gmail.com> on 2006/09/21 10:07:30 UTC
[Non-bug difference]? JIRA-1126
Hi All:
I suggest to change JIRA 1126 into non-bug difference. Below is all the
comment on JIRA 1126:
>>The Harmony method URI.parseServerAuthority() throws
URISyntaxException for uri 'file://C:/1.txt' while RI returns correct
value.
>>==================== test.java =====================
>>import java.net.*;
>> public class test {
>> public static void main (String[] args) throws Exception {
>> System.out.println("res = " +
URI.create("file://C:/1.txt").parseServerAuthority());
>> }
>> }
>>================================================
>>Output:
>>C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp .
-showversion test
>>java version "1.5.0"
>>Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
>> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32,
R25.0.0-75, GC: System optimized over throughput (initial strategy
singleparpar))
>>res = file://C:/1.txt
>>C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp .
-showversion test
>>java version 1.5 (subset)
>>(c) Copyright 1991, 2006 The Apache Software Foundation or its
licensors, as applicable.
>>Exception in thread "main" java.net.URISyntaxException: Invalid port
number at index 2: C:
>> at java.net.URI$Helper.parseAuthority(URI.java:417)
>> at java.net.URI$Helper.access$1500(URI.java:22)
>> at java.net.URI.parseServerAuthority(URI.java:1217)
>> at test.main(test.java:6)
*Description*
The Harmony method URI.parseServerAuthority() throws
URISyntaxException for uri 'file://C:/1.txt' while RI returns correct
value. ==================== test.java ===================== import
java.net.*; public class test { public static void main (String[]
args) throws Exception { System.out.println("res = " +
URI.create("file://C:/1.txt").parseServerAuthority()); } }
================================================ Output:
C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -cp .
-showversion test java version "1.5.0" Java(TM) 2 Runtime Environment,
Standard Edition (build 1.5.0-b64) BEA WebLogic JRockit(R) (build
dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over
throughput (initial strategy singleparpar)) res = file://C:/1.txt
C:\tmp\tmp17>C:\harmony\classlib1.5\deploy\jdk\jre\bin\java.exe -cp .
-showversion test java version 1.5 (subset) (c) Copyright 1991, 2006 The
Apache Software Foundation or its licensors, as applicable. Exception in
thread "main" java.net.URISyntaxException: Invalid port number at index
2: C: at java.net.URI$Helper.parseAuthority(URI.java:417)
at java.net.URI$Helper.access$1500(URI.java:22) at
java.net.URI.parseServerAuthority(URI.java:1217) at
test.main(test.java:6)
Show » <http://issues.apache.org/jira/browse/HARMONY-1126>
>>Vladimir Ivanov
<http://issues.apache.org/jira/secure/ViewProfile.jspa?name=vladimir>
>>unit test.
>>Seems, that patch will be system dependent (special handling for Win
should be added)
[ Show » <http://issues.apache.org/jira/browse/HARMONY-1126> ]
Vladimir Ivanov
<http://issues.apache.org/jira/secure/ViewProfile.jspa?name=vladimir>
[09/Aug/06 09:05 PM] unit test. Seems, that patch will be system
dependent (special handling for Win should be added)
>>spark shen
<http://issues.apache.org/jira/secure/ViewProfile.jspa?name=spark+shen>
>>I think RI(Should be harmony, I mis-typed it into RI on JIRA, sorry
for that :-) ) is more reasonable, since according to RFC-2396 (3.2.2.
Server-based Naming Authority)
>> hostport = host [ ":" port ]
>> host = hostname | IPv4address
>> hostname = *( domainlabel "." ) toplabel [ "." ]
>> domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
>> toplabel = alpha | alpha *( alphanum | "-" ) alphanum
>> IPv4address = 1*digit "." 1*digit "." 1*digit "." 1*digit
>> port = *digit
>> ':' only appears in [":"port] part, and never appears in host part.
>> Correct me if I am wrong.
Best regards
--
Spark Shen
China Software Development Lab, IBM
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [Non-bug difference]? JIRA-1126
Posted by Spark Shen <sm...@gmail.com>.
2006/9/21, Oleg Khaschansky <ol...@gmail.com>:
>
> I'd like to quote RFC 2396 here:
>
> "The URI syntax does not require that the scheme-specific-part have
> any general structure or set of semantics which is common among all
> URI. However, a subset of URI do share a common syntax for
> representing hierarchical relationships within the namespace. This
> "generic URI" syntax consists of a sequence of four main components:
>
> <scheme>://<authority><path>?<query>
>
> each of which, except <scheme>, may be absent from a particular URI."
>
> ...
>
> "We use the term <path> to refer to both the <abs_path> and
> <opaque_part> constructs, since they are mutually exclusive for any
> given URI and can be parsed as a single component."
>
> So "file://C:/1.txt" appears to be a valid URI of the following kind:
> <scheme>://<path>, where <path> is an <opaque_part>.
I still think this is a bug of RI. According to RFC2396, to be recognized as
server-based authority, the uri should obey a more formal rule(than
registry-based authority). Apparently,
file://C:/1.txt can only be recognized as a registry-based authority.
[cite]
Otherwise this method attempts once more to parse the authority component
into user-information, host, and port components, and throws an exception
describing why the authority component could not be parsed in that way.
This method is provided because the generic URI syntax specified in RFC
2396 cannot always distinguish a malformed server-based authority from a
legitimate registry-based authority.
[cite]
IMHO, this paragraph of depiction aims to say that this method is used to
strictly distinguish server-based authority from a legitimate registry-based
authority.
And will throw exception if the URI is not a server-based authority.
But RI apparently do not behave as spec depicts, so I suggest to change the
component to non-bug difference.
Best regards
This means that #1126 is, actually, a bug. Am I correct?
>
>
> On 9/21/06, Spark Shen <sm...@gmail.com> wrote:
> > [snip]
> > >
> > >
> > > >>Vladimir Ivanov
> > > <http://issues.apache.org/jira/secure/ViewProfile.jspa?name=vladimir>
> > > >>unit test.
> > > >>Seems, that patch will be system dependent (special handling for Win
> > > should be added)
> > [snip]
> > And I agree with Vladimir Ivanov here, on Win-platform, special handling
> > for file system is needed.
> >
> > Best regards
> >
> > --
> > Spark Shen
> > China Software Development Lab, IBM
> >
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
--
Spark Shen
China Software Development Lab, IBM
Re: [Non-bug difference]? JIRA-1126
Posted by Oleg Khaschansky <ol...@gmail.com>.
I'd like to quote RFC 2396 here:
"The URI syntax does not require that the scheme-specific-part have
any general structure or set of semantics which is common among all
URI. However, a subset of URI do share a common syntax for
representing hierarchical relationships within the namespace. This
"generic URI" syntax consists of a sequence of four main components:
<scheme>://<authority><path>?<query>
each of which, except <scheme>, may be absent from a particular URI."
...
"We use the term <path> to refer to both the <abs_path> and
<opaque_part> constructs, since they are mutually exclusive for any
given URI and can be parsed as a single component."
So "file://C:/1.txt" appears to be a valid URI of the following kind:
<scheme>://<path>, where <path> is an <opaque_part>.
This means that #1126 is, actually, a bug. Am I correct?
On 9/21/06, Spark Shen <sm...@gmail.com> wrote:
> [snip]
> >
> >
> > >>Vladimir Ivanov
> > <http://issues.apache.org/jira/secure/ViewProfile.jspa?name=vladimir>
> > >>unit test.
> > >>Seems, that patch will be system dependent (special handling for Win
> > should be added)
> [snip]
> And I agree with Vladimir Ivanov here, on Win-platform, special handling
> for file system is needed.
>
> Best regards
>
> --
> Spark Shen
> China Software Development Lab, IBM
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org
Re: [Non-bug difference]? JIRA-1126
Posted by Spark Shen <sm...@gmail.com>.
[snip]
>
>
> >>Vladimir Ivanov
> <http://issues.apache.org/jira/secure/ViewProfile.jspa?name=vladimir>
> >>unit test.
> >>Seems, that patch will be system dependent (special handling for Win
> should be added)
[snip]
And I agree with Vladimir Ivanov here, on Win-platform, special handling
for file system is needed.
Best regards
--
Spark Shen
China Software Development Lab, IBM
---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org