Skip to content

Commit 9dfa46f

Browse files
committed
Remove GraalVM workaround in PathMatchingResourcePatternResolver
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
1 parent ca5e453 commit 9dfa46f

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -740,19 +740,6 @@ protected Set<Resource> doFindPathMatchingFileResources(Resource rootDirResource
740740
URI rootDirUri;
741741
try {
742742
rootDirUri = rootDirResource.getURI();
743-
// If the URI is for a "resource" in the GraalVM native image file system, we have to
744-
// ensure that the root directory does not end in a slash while simultaneously ensuring
745-
// that the root directory is not an empty string (since Path#resolve throws an
746-
// ArrayIndexOutOfBoundsException in a native image if the initial Path is created
747-
// from an empty string).
748-
String scheme = rootDirUri.getScheme();
749-
String path = rootDirUri.getPath();
750-
if ("resource".equals(scheme) && (path.length() > 1) && path.endsWith("/")) {
751-
path = path.substring(0, path.length() - 1);
752-
// Retain the fragment as well, since root folders in the native image
753-
// file system are indexed via the fragment (e.g., resource:/#1).
754-
rootDirUri = new URI(scheme, path, rootDirUri.getFragment());
755-
}
756743
}
757744
catch (Exception ex) {
758745
if (logger.isInfoEnabled()) {

0 commit comments

Comments
 (0)