[crac] RFR: Ignore errors parsing classpath

Jan Kratochvil jkratochvil at openjdk.org
Fri Feb 2 08:26:29 UTC 2024


On Fri, 15 Dec 2023 09:45:49 GMT, Radim Vansa <rvansa 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.

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

PR Review Comment: https://git.openjdk.org/crac/pull/149#discussion_r1475716646


More information about the crac-dev mailing list