You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tony Wu (JIRA)" <ji...@apache.org> on 2007/01/05 07:02:28 UTC

[jira] Commented: (HARMONY-2941) [classlib][luni]No exception was thrown when parseURL with limit = Integer.MIN_VALUE

    [ https://issues.apache.org/jira/browse/HARMONY-2941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462413 ] 

Tony Wu commented on HARMONY-2941:
----------------------------------

Patch available, would you please try it, thanks a lot!

> [classlib][luni]No exception was thrown when parseURL with limit = Integer.MIN_VALUE
> ------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2941
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2941
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Tony Wu
>         Attachments: harmony-2941.diff
>
>
> RI throws exception in following testcase whereas harmony return silently
> public class URLStreamHandlerTest  extends TestCase
> static class MyURLStreamHandler extends URLStreamHandler {
>         @Override
>         protected URLConnection openConnection(URL arg0) throws IOException {
>             return null;
>         }
>         public void parse(URL url, String spec, int start, int end) {
>             parseURL(url, spec, start, end);
>         }
>     }
>     static class MyURLStreamHandlerFactory implements URLStreamHandlerFactory {
>         public static MyURLStreamHandler handler = new MyURLStreamHandler();
>         public URLStreamHandler createURLStreamHandler(String arg0) {
>             handler = new MyURLStreamHandler();
>             return handler;
>         }
>     }
>     public void test_parseURL() throws MalformedURLException {
>         URL.setURLStreamHandlerFactory(new MyURLStreamHandlerFactory());
>         URL url = new URL("http://localhost");
>         MyURLStreamHandler handler = MyURLStreamHandlerFactory.handler;
>         try {
>             handler.parse(url, "//", 0, Integer.MIN_VALUE);
>             fail("Should throw SIOOBE.");
>         } catch (StringIndexOutOfBoundsException e) {
>             // expected;
>         }
>     }
> }

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