Skip to content

Commit f1f0d68

Browse files
committed
[GR-32432] Fix bundle lookup for bundles in unnamed packages.
PullRequest: graal/9275
2 parents 91d8e9b + fd94991 commit f1f0d68

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

substratevm/src/com.oracle.svm.hosted.jdk11/src/com/oracle/svm/hosted/jdk11/ClassLoaderSupportImplJDK11OrLater.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import java.util.List;
3535
import java.util.Locale;
3636
import java.util.Map;
37-
import java.util.MissingResourceException;
3837
import java.util.ResourceBundle;
3938
import java.util.Set;
4039
import java.util.stream.Collectors;
@@ -80,9 +79,6 @@ public List<ResourceBundle> getResourceBundle(String bundleSpec, Locale locale)
8079
bundleName = specParts[0];
8180
}
8281
String packageName = packageName(bundleName);
83-
if (packageName == null) {
84-
throw new MissingResourceException("ResourceBundle does not seem to be a fully qualified class name.", bundleName, locale.toLanguageTag());
85-
}
8682
Set<Module> modules;
8783
if (moduleName != null) {
8884
modules = classLoaderSupport.findModule(moduleName).stream().collect(Collectors.toSet());
@@ -107,8 +103,7 @@ public List<ResourceBundle> getResourceBundle(String bundleSpec, Locale locale)
107103
private static String packageName(String bundleName) {
108104
int classSep = bundleName.replace('/', '.').lastIndexOf('.');
109105
if (classSep == -1) {
110-
/* The bundle is not specified via a java.class or java.properties format. */
111-
return null;
106+
return ""; /* unnamed package */
112107
}
113108
return bundleName.substring(0, classSep);
114109
}

0 commit comments

Comments
 (0)