On Sat, 13 Aug 2022 03:41:04 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

>> Christian Stein has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Remove unused import statement
>
> test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPPolicyManager.java line 217:
> 
>> 215:         URL loc = (cs == null) ? null : cs.getLocation();
>> 216:         String path = (loc == null) ? null : loc.getPath();
>> 217:         String name = (path == null) ? null : 
>> path.substring(path.lastIndexOf('/') + 1);
> 
> Is there a chance that this path could end with `/` and thus lead to a 
> `IndexOutOfBoundsException` on this call to `substring`?

Yes. Usually the URL of the domain's code source points to a JAR file - but it 
is possible that a directory is the code source. Then the URL could end with a 
`/` character.

Will refactor the fix to use `Path::getFileName`.

-------------

PR: https://git.openjdk.org/jdk/pull/9857

Reply via email to