/** * Try to get a {@link ResourceBundle} for the given {@code forcedLocale}. * If none is found try to fallback to the bundle for the set {@link Locale} * * @param forcedLocale the {@link Locale} which should be used first * @return the resolved {@link ResourceBundle} or {@code null}, if none could be found */ private static ResourceBundle getBundle(Locale forcedLocale) { for (Locale locale: Arrays.asList(forcedLocale, getLocale())) { if(locale != null) { ResourceBundle bundle = ResourceBundle.getBundle("org.apache.jmeter.resources.messages", locale); // $NON-NLS-1$ if (bundle == null) { log.warn("Could not resolve ResourceBundle for Locale [{}]", locale); } else { return bundle; } } } return new DummyResourceBundle(); }