Skip to content

Commit 08a01ca

Browse files
committed
Fixed registering ResourceBundles with RuntimeResourceAccess.
1 parent e19a432 commit 08a01ca

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/hosted/RuntimeResourceAccess.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -115,7 +115,7 @@ public static void addResourceBundle(Module module, String bundleName) {
115115
private static String withModuleName(Module module, String str) {
116116
Objects.requireNonNull(module);
117117
Objects.requireNonNull(str);
118-
return (module.isNamed() ? module.getName() : "ALL-UNNAMED") + ":" + str;
118+
return module.isNamed() ? module.getName() + ":" + str : str;
119119
}
120120

121121
private RuntimeResourceAccess() {

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jdk/localization/LocalizationFeature.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
import com.oracle.svm.core.option.HostedOptionKey;
8282
import com.oracle.svm.core.util.UserError;
8383
import com.oracle.svm.core.util.VMError;
84+
import com.oracle.svm.hosted.FeatureImpl.AfterRegistrationAccessImpl;
8485
import com.oracle.svm.hosted.FeatureImpl.DuringAnalysisAccessImpl;
8586
import com.oracle.svm.hosted.FeatureImpl.DuringSetupAccessImpl;
8687
import com.oracle.svm.hosted.ImageClassLoader;
@@ -279,6 +280,7 @@ public void afterRegistration(AfterRegistrationAccess access) {
279280
*/
280281
addProviders();
281282
}
283+
this.imageClassLoader = ((AfterRegistrationAccessImpl) access).getImageClassLoader();
282284
}
283285

284286
@Override
@@ -297,7 +299,6 @@ public void duringSetup(DuringSetupAccess a) {
297299
ServiceLoader.load(ResourceBundleControlProvider.class).stream()
298300
.forEach(provider -> ImageSingletons.lookup(RuntimeClassInitializationSupport.class).initializeAtBuildTime(provider.type(), reason));
299301

300-
this.imageClassLoader = access.getImageClassLoader();
301302
}
302303

303304
/**

0 commit comments

Comments
 (0)