diff --git a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/Activator.java b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/Activator.java index 91617940757..99582d26087 100644 --- a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/Activator.java +++ b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/Activator.java @@ -197,11 +197,13 @@ public String getBundleId(Object object) { * in the given locale. Does not return null. * @throws MissingResourceException If the corresponding resource could not be found */ - public ResourceBundle getLocalization(Bundle bundle, String locale) throws MissingResourceException { - if (localizationTracker == null) { - throw new MissingResourceException(CommonMessages.activator_resourceBundleNotStarted, bundle.getSymbolicName(), ""); //$NON-NLS-1$ + public static ResourceBundle getLocalization(Bundle bundle, String locale) throws MissingResourceException { + Activator activator = Activator.getDefault(); + if (activator == null) { + throw new MissingResourceException(CommonMessages.activator_resourceBundleNotStarted, + bundle.getSymbolicName(), ""); //$NON-NLS-1$ } - BundleLocalization location = localizationTracker.current().orElse(null); + BundleLocalization location = activator.localizationTracker.current().orElse(null); ResourceBundle result = null; if (location != null) result = location.getLocalization(bundle, locale); diff --git a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/ResourceTranslator.java b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/ResourceTranslator.java index f0b5a572c7e..b2122e4f6a5 100644 --- a/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/ResourceTranslator.java +++ b/bundles/org.eclipse.equinox.common/src/org/eclipse/core/internal/runtime/ResourceTranslator.java @@ -70,7 +70,7 @@ private static ResourceBundle getResourceBundle(Bundle bundle, String language) Locale locale = (language == null) ? Locale.getDefault() : new Locale(language); return ResourceBundle.getBundle("plugin", locale, createTempClassloader(bundle)); //$NON-NLS-1$ } - return Activator.getDefault().getLocalization(bundle, language); + return Activator.getLocalization(bundle, language); } public static String[] getResourceString(Bundle bundle, String[] nonTranslated, String locale) {