[crac] RFR: Ignore errors parsing classpath
Radim Vansa
rvansa at openjdk.org
Tue Feb 6 09:44:25 UTC 2024
On Fri, 2 Feb 2024 08:23:05 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:
>> This test is relevant mostly on Windows - trying to use URI in the form of `file:/C:/path/to/...` as classpath element. On Linux, this is parsed as two items as `File.pathSeparator` is `:`. However on Windows the second colon triggers an exception.
>
> src/java.base/share/classes/jdk/internal/crac/JDKFileResource.java line 34:
>
>> 32: } catch (Exception e) {
>> 33: // Ignore any exception parsing the path: URLClassPath.toFileURL() ignores IOExceptions
>> 34: // as well, here we might get InvalidPathException
>
> I think `CLASSPATH_ENTRIES[i]` will remain `null` in such case and later code in this file accesses it without a `null` check. But I haven't tried to reproduce it on Windows.
Correct, I need to push an update to this.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/149#discussion_r1479482308
More information about the crac-dev
mailing list