Skip to content

Commit ebd0112

Browse files
committed
Switch to using .isRegisteredBundleLookup to decide if we should show MissingResourceRegistrationError
1 parent c3456cb commit ebd0112

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/localization/substitutions/Target_java_util_ResourceBundle.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
package com.oracle.svm.core.jdk.localization.substitutions;
2626

2727
import java.util.Locale;
28-
import java.util.MissingResourceException;
2928
import java.util.Objects;
3029
import java.util.ResourceBundle;
3130
import java.util.ResourceBundle.Control;
@@ -155,12 +154,14 @@ private static ResourceBundle getBundleFromModule(Class<?> caller,
155154
Control control) {
156155
Objects.requireNonNull(module);
157156
Module callerModule = getCallerModule(caller);
158-
try {
159-
return MissingRegistrationUtils.runIgnoringMissingRegistrations(() -> getBundleImpl(callerModule, module, baseName, locale, control));
160-
} catch (MissingResourceException mre) {
157+
/*
158+
* TODO GR-67556 - Implement proper module-aware LocalizationSupport bundle registration to
159+
* ensure we show MissingResourceRegistrationError in all relevant situations.
160+
*/
161+
if (!ImageSingletons.lookup(LocalizationSupport.class).isRegisteredBundleLookup(baseName, locale, control)) {
161162
MissingResourceRegistrationUtils.reportResourceBundleAccess(module, baseName);
162-
throw mre;
163163
}
164+
return MissingRegistrationUtils.runIgnoringMissingRegistrations(() -> getBundleImpl(callerModule, module, baseName, locale, control));
164165
}
165166

166167
@Alias

0 commit comments

Comments
 (0)