Skip to content

Commit

Permalink
Remove GraalVM workaround in PathMatchingResourcePatternResolver
Browse files Browse the repository at this point in the history
Tested successfully using the following locally built GraalVM dev build.

OpenJDK Runtime Environment GraalVM 22.3.0-dev (build 17.0.5+5-jvmci-22.3-b07)

Closes gh-29214
  • Loading branch information
sbrannen committed Oct 18, 2022
1 parent ca5e453 commit 9dfa46f
Showing 1 changed file with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -740,19 +740,6 @@ protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource
URI rootDirUri;
try {
rootDirUri = rootDirResource.getURI();
// If the URI is for a "resource" in the GraalVM native image file system, we have to
// ensure that the root directory does not end in a slash while simultaneously ensuring
// that the root directory is not an empty string (since Path#resolve throws an
// ArrayIndexOutOfBoundsException in a native image if the initial Path is created
// from an empty string).
String scheme = rootDirUri.getScheme();
String path = rootDirUri.getPath();
if ("resource".equals(scheme) && (path.length() > 1) && path.endsWith("/")) {
path = path.substring(0, path.length() - 1);
// Retain the fragment as well, since root folders in the native image
// file system are indexed via the fragment (e.g., resource:/#1).
rootDirUri = new URI(scheme, path, rootDirUri.getFragment());
}
}
catch (Exception ex) {
if (logger.isInfoEnabled()) {
Expand Down

0 comments on commit 9dfa46f

Please sign in to comment.