You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2009/07/01 16:19:47 UTC

[jira] Created: (HARMONY-6254) [classlib][luni] URLStreamHandler throws NPE when creating external form

[classlib][luni] URLStreamHandler throws NPE when creating external form
------------------------------------------------------------------------

                 Key: HARMONY-6254
                 URL: https://issues.apache.org/jira/browse/HARMONY-6254
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M10
            Reporter: Tim Ellison


The following test fails on Harmony M10 but passes on the RI

public class URLTest {

    // Bogus handler forces file part of URL to be null
    static class MyHandler extends URLStreamHandler {

        @Override
        protected URLConnection openConnection(URL arg0) throws IOException {
            return null;
        }

        @Override
        protected void setURL(URL u, String protocol, String host, int port,
                String authority, String userInfo, String file, String query,
                String ref) {
            super.setURL(u, protocol, host, port, authority, userInfo,
                    (String) null, query, ref);
        }
    }

    public static void main(String[] args) throws IOException {
        URLStreamHandler myHandler = new MyHandler();
        URL url = new URL(null, "foobar://example.com/foobar", myHandler);
        String s = url.toExternalForm();
        System.out.println(s);
    }
}

The RI prints out:
foobar://example.com

but Harmony M10 prints out:

Uncaught exception in main:
Caused by: java.lang.NullPointerException
        at java.net.URLStreamHandler.toExternalForm(URLStreamHandler.java:309)
        at java.net.URL.toExternalForm(URL.java:728)
        at URLTest.main(URLTest.java:28)
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
        ... 2 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-6254) [classlib][luni] URLStreamHandler throws NPE when creating external form

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison resolved HARMONY-6254.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 5.0M11

Fixed in LUNI module at repo revision r790210.



> [classlib][luni] URLStreamHandler throws NPE when creating external form
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-6254
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6254
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M10
>            Reporter: Tim Ellison
>            Assignee: Tim Ellison
>             Fix For: 5.0M11
>
>         Attachments: harmony-6254.patch
>
>
> The following test fails on Harmony M10 but passes on the RI
> public class URLTest {
>     // Bogus handler forces file part of URL to be null
>     static class MyHandler extends URLStreamHandler {
>         @Override
>         protected URLConnection openConnection(URL arg0) throws IOException {
>             return null;
>         }
>         @Override
>         protected void setURL(URL u, String protocol, String host, int port,
>                 String authority, String userInfo, String file, String query,
>                 String ref) {
>             super.setURL(u, protocol, host, port, authority, userInfo,
>                     (String) null, query, ref);
>         }
>     }
>     public static void main(String[] args) throws IOException {
>         URLStreamHandler myHandler = new MyHandler();
>         URL url = new URL(null, "foobar://example.com/foobar", myHandler);
>         String s = url.toExternalForm();
>         System.out.println(s);
>     }
> }
> The RI prints out:
> foobar://example.com
> but Harmony M10 prints out:
> Uncaught exception in main:
> Caused by: java.lang.NullPointerException
>         at java.net.URLStreamHandler.toExternalForm(URLStreamHandler.java:309)
>         at java.net.URL.toExternalForm(URL.java:728)
>         at URLTest.main(URLTest.java:28)
>         at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
>         ... 2 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-6254) [classlib][luni] URLStreamHandler throws NPE when creating external form

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison updated HARMONY-6254:
---------------------------------

    Attachment: harmony-6254.patch

Proposed fix.

> [classlib][luni] URLStreamHandler throws NPE when creating external form
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-6254
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6254
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M10
>            Reporter: Tim Ellison
>            Assignee: Tim Ellison
>         Attachments: harmony-6254.patch
>
>
> The following test fails on Harmony M10 but passes on the RI
> public class URLTest {
>     // Bogus handler forces file part of URL to be null
>     static class MyHandler extends URLStreamHandler {
>         @Override
>         protected URLConnection openConnection(URL arg0) throws IOException {
>             return null;
>         }
>         @Override
>         protected void setURL(URL u, String protocol, String host, int port,
>                 String authority, String userInfo, String file, String query,
>                 String ref) {
>             super.setURL(u, protocol, host, port, authority, userInfo,
>                     (String) null, query, ref);
>         }
>     }
>     public static void main(String[] args) throws IOException {
>         URLStreamHandler myHandler = new MyHandler();
>         URL url = new URL(null, "foobar://example.com/foobar", myHandler);
>         String s = url.toExternalForm();
>         System.out.println(s);
>     }
> }
> The RI prints out:
> foobar://example.com
> but Harmony M10 prints out:
> Uncaught exception in main:
> Caused by: java.lang.NullPointerException
>         at java.net.URLStreamHandler.toExternalForm(URLStreamHandler.java:309)
>         at java.net.URL.toExternalForm(URL.java:728)
>         at URLTest.main(URLTest.java:28)
>         at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
>         ... 2 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-6254) [classlib][luni] URLStreamHandler throws NPE when creating external form

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison closed HARMONY-6254.
--------------------------------


> [classlib][luni] URLStreamHandler throws NPE when creating external form
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-6254
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6254
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M10
>            Reporter: Tim Ellison
>            Assignee: Tim Ellison
>             Fix For: 5.0M11
>
>         Attachments: harmony-6254.patch
>
>
> The following test fails on Harmony M10 but passes on the RI
> public class URLTest {
>     // Bogus handler forces file part of URL to be null
>     static class MyHandler extends URLStreamHandler {
>         @Override
>         protected URLConnection openConnection(URL arg0) throws IOException {
>             return null;
>         }
>         @Override
>         protected void setURL(URL u, String protocol, String host, int port,
>                 String authority, String userInfo, String file, String query,
>                 String ref) {
>             super.setURL(u, protocol, host, port, authority, userInfo,
>                     (String) null, query, ref);
>         }
>     }
>     public static void main(String[] args) throws IOException {
>         URLStreamHandler myHandler = new MyHandler();
>         URL url = new URL(null, "foobar://example.com/foobar", myHandler);
>         String s = url.toExternalForm();
>         System.out.println(s);
>     }
> }
> The RI prints out:
> foobar://example.com
> but Harmony M10 prints out:
> Uncaught exception in main:
> Caused by: java.lang.NullPointerException
>         at java.net.URLStreamHandler.toExternalForm(URLStreamHandler.java:309)
>         at java.net.URL.toExternalForm(URL.java:728)
>         at URLTest.main(URLTest.java:28)
>         at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
>         ... 2 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-6254) [classlib][luni] URLStreamHandler throws NPE when creating external form

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-6254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Ellison reassigned HARMONY-6254:
------------------------------------

    Assignee: Tim Ellison

> [classlib][luni] URLStreamHandler throws NPE when creating external form
> ------------------------------------------------------------------------
>
>                 Key: HARMONY-6254
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6254
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M10
>            Reporter: Tim Ellison
>            Assignee: Tim Ellison
>         Attachments: harmony-6254.patch
>
>
> The following test fails on Harmony M10 but passes on the RI
> public class URLTest {
>     // Bogus handler forces file part of URL to be null
>     static class MyHandler extends URLStreamHandler {
>         @Override
>         protected URLConnection openConnection(URL arg0) throws IOException {
>             return null;
>         }
>         @Override
>         protected void setURL(URL u, String protocol, String host, int port,
>                 String authority, String userInfo, String file, String query,
>                 String ref) {
>             super.setURL(u, protocol, host, port, authority, userInfo,
>                     (String) null, query, ref);
>         }
>     }
>     public static void main(String[] args) throws IOException {
>         URLStreamHandler myHandler = new MyHandler();
>         URL url = new URL(null, "foobar://example.com/foobar", myHandler);
>         String s = url.toExternalForm();
>         System.out.println(s);
>     }
> }
> The RI prints out:
> foobar://example.com
> but Harmony M10 prints out:
> Uncaught exception in main:
> Caused by: java.lang.NullPointerException
>         at java.net.URLStreamHandler.toExternalForm(URLStreamHandler.java:309)
>         at java.net.URL.toExternalForm(URL.java:728)
>         at URLTest.main(URLTest.java:28)
>         at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
>         ... 2 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.