harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Catherine Hope (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-6499) [classlib][luni] URLStreamHandler.parseURL throws different exception to RI in some cases
Date Fri, 16 Apr 2010 15:30:29 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-6499?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Catherine Hope updated HARMONY-6499:

    Attachment: 6499.patch

Attached patch changes the parseURL method as follows:
- if the end index is less than the start index - make additional compatibility checks and
throw StringIndexOufOfBoundsException if required, then make security check
- otherwise call String.substring method and parse the URL

I've moved the existing compatibility check into the first conditional so it's a bit more
efficient, though it is still an ugly workaround.  I did try doing the bounds checks as the
URL was parsed but it was even harder to match behaviour.

> [classlib][luni] URLStreamHandler.parseURL throws different exception to RI in some cases
> -----------------------------------------------------------------------------------------
>                 Key: HARMONY-6499
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6499
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Catherine Hope
>         Attachments: 6499.patch
> java.net.URLStreamHandler throws a SecurityException in some situations where the RI
will throw a StringIndexOutOfBoundsException.  From experimenting with test cases I think
the RI is checking bounds as it parses the URL and not up front, which causes some inconsistent
behaviour.  There's already one work-around added to this method in order to make it more
compatible (HARMONY-2941)
> The following all throw SecurityExceptions on Harmony (when called with a handler that
is not the URL's protocol handler) where they throw StringIndexOutOfBoundsExceptions on the
> handler.parse(url, "any", 10, Integer.MIN_VALUE);
> handler.parse(url, "any", 10, Integer.MIN_VALUE+1);
> handler.parse(url, "any", Integer.MIN_VALUE, Integer.MIN_VALUE);
> handler.parse(url, "any", Integer.MIN_VALUE, 2);

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


View raw message