You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vladimir Ivanov (JIRA)" <ji...@apache.org> on 2006/08/10 06:22:17 UTC

[jira] Created: (HARMONY-1127) [classlib][net] compatibility: Harmony constructor URI(String * 5) throws URISyntaxExceptionwhile RI does not

[classlib][net] compatibility: Harmony constructor URI(String * 5) throws URISyntaxExceptionwhile RI does not
-------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-1127
                 URL: http://issues.apache.org/jira/browse/HARMONY-1127
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Vladimir Ivanov


The Harmony method java.net.URI(String scheme, String authority, String path, String query, String fragment) throws URISyntaxException for incorrect ipv6 address while RI silently skip it.
Note, the URI unit test for this constructor failed on RI and passed on Harmony.

====================== test.java =======================
import java.net.*;

public class test  { 
    public static void main (String[] args) throws Exception {
        System.out.println("res = " + new URI("ftp", "[www.abc.com]", "/dir", "query", "frag"));
    }     
}
====================================================

Output:
C:\tmp\tmp17>C:\jdk1.5.0_06\bin\java.exe -cp . -showversion test
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

res = ftp:///dir?query#frag

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: Malformed ipv6 address: [www.abc.com]
        at java.net.URI$Helper.isValidHost(URI.java:467)
        at java.net.URI$Helper.parseAuthority(URI.java:431)
        at java.net.URI$Helper.parseURI(URI.java:31)
        at java.net.URI$Helper.access$100(URI.java:22)
        at java.net.URI.<init>(URI.java:199)
        at test.main(test.java:5)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-1127) [classlib][net] compatibility: Harmony constructor URI(String * 5) throws URISyntaxExceptionwhile RI does not

Posted by "Alexey Petrenko (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-1127?page=comments#action_12427242 ] 
            
Alexey Petrenko commented on HARMONY-1127:
------------------------------------------

But Harmony seems correct here.

> [classlib][net] compatibility: Harmony constructor URI(String * 5) throws URISyntaxExceptionwhile RI does not
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1127
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1127
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vladimir Ivanov
>
> The Harmony method java.net.URI(String scheme, String authority, String path, String query, String fragment) throws URISyntaxException for incorrect ipv6 address while RI silently skip it.
> Note, the URI unit test for this constructor failed on RI and passed on Harmony.
> ====================== test.java =======================
> import java.net.*;
> public class test  { 
>     public static void main (String[] args) throws Exception {
>         System.out.println("res = " + new URI("ftp", "[www.abc.com]", "/dir", "query", "frag"));
>     }     
> }
> ====================================================
> Output:
> C:\tmp\tmp17>C:\jdk1.5.0_06\bin\java.exe -cp . -showversion test
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> res = ftp:///dir?query#frag
> 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: Malformed ipv6 address: [www.abc.com]
>         at java.net.URI$Helper.isValidHost(URI.java:467)
>         at java.net.URI$Helper.parseAuthority(URI.java:431)
>         at java.net.URI$Helper.parseURI(URI.java:31)
>         at java.net.URI$Helper.access$100(URI.java:22)
>         at java.net.URI.<init>(URI.java:199)
>         at test.main(test.java:5)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (HARMONY-1127) [classlib][net] compatibility: Harmony constructor URI(String * 5) throws URISyntaxExceptionwhile RI does not

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-1127?page=all ]

Tim Ellison reassigned HARMONY-1127:
------------------------------------

    Assignee: Tim Ellison

> [classlib][net] compatibility: Harmony constructor URI(String * 5) throws URISyntaxExceptionwhile RI does not
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1127
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1127
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Vladimir Ivanov
>         Assigned To: Tim Ellison
>
> The Harmony method java.net.URI(String scheme, String authority, String path, String query, String fragment) throws URISyntaxException for incorrect ipv6 address while RI silently skip it.
> Note, the URI unit test for this constructor failed on RI and passed on Harmony.
> ====================== test.java =======================
> import java.net.*;
> public class test  { 
>     public static void main (String[] args) throws Exception {
>         System.out.println("res = " + new URI("ftp", "[www.abc.com]", "/dir", "query", "frag"));
>     }     
> }
> ====================================================
> Output:
> C:\tmp\tmp17>C:\jdk1.5.0_06\bin\java.exe -cp . -showversion test
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
> res = ftp:///dir?query#frag
> 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: Malformed ipv6 address: [www.abc.com]
>         at java.net.URI$Helper.isValidHost(URI.java:467)
>         at java.net.URI$Helper.parseAuthority(URI.java:431)
>         at java.net.URI$Helper.parseURI(URI.java:31)
>         at java.net.URI$Helper.access$100(URI.java:22)
>         at java.net.URI.<init>(URI.java:199)
>         at test.main(test.java:5)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira