You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As stated in #5020 (comment) and #5020 (comment), if you invoke fileSystem.getPath("") against the native image FileSystem and then invoke resolve(...) on that Path, you get the following exception.
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 0
com.oracle.svm.core.jdk.resources.NativeImageResourcePath.resolve(NativeImageResourcePath.java:302)
com.oracle.svm.core.jdk.resources.NativeImageResourcePath.resolve(NativeImageResourcePath.java:327)
Whereas, a Path created by the standard OS FileSystem does not throw an exception in that scenario.
So it would be great if commit messages would include the related GitHub issue(s) (like #5081 or gh-5081).
fniephaus
changed the title
Native Image FileSystem throws exception when resolving against an empty Path
[GR-41420] Native Image FileSystem throws exception when resolving against an empty Path
Oct 11, 2022
@fniephaus and @vjovanov, is there any way to have related commits automatically linked to the corresponding GitHub issue?
Thanks for the feedback, @sbrannen. Typically, we add the internal tracking code (e.g., GR-41420) as a prefix to the GitHub issue and then there is going to be a merge with the fix matching that prefix (@jovanstevanovic is a relatively new team member and doesn't know all these details yet, I took care of it just now). I understand this situation is not ideal and GitHub provides different ways to connect issues, commits, and PRs. Although I'm glad that our CI system is smart enough to automate a lot of things for us behind the curtain, it's not yet smart enough to take advantages of those GitHub features but we're working on it. :)
Overview
As stated in #5020 (comment) and #5020 (comment), if you invoke
fileSystem.getPath("")
against the native imageFileSystem
and then invokeresolve(...)
on thatPath
, you get the following exception.Whereas, a
Path
created by the standard OSFileSystem
does not throw an exception in that scenario.For example...
... the above code prints the following on the JVM as well as within a native image.
Whereas, when executing the following within a native image...
... that prints:
... and then throws the aforementioned
ArrayIndexOutOfBoundsException
.Cause of the exception
In the following line of code...
graal/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/resources/NativeImageResourcePath.java
Line 302 in 3950e04
... if
p1.path.length
is 0, then you get theArrayIndexOutOfBoundsException
.System Tested
The text was updated successfully, but these errors were encountered: