@Test public void testGetResourceBundleUnknown() throws Exception { String locale = "xyz"; String[] defaultLocaleArray = new String[] {"en", "nl"}; for (String defaultLocale : defaultLocaleArray) { Locale.setDefault(LocaleUtils.toLocale(defaultLocale)); ResourceBundle resourceBundle = ComponentUtil.getCurrentResourceBundle(locale); Assert.assertEquals(defaultLocale.toLowerCase(), resourceBundle.getLocale().toString().toLowerCase()); } }
public static ResourceBundle getCurrentResourceBundle(String locale) { try { if (null != locale && !locale.isEmpty()) { return getCurrentResourceBundle(LocaleUtils.toLocale(locale)); } } catch (IllegalArgumentException ex) { } return getCurrentResourceBundle((Locale) null); }
ComponentUtil { public static ResourceBundle getCurrentResourceBundle(String locale) { try { if (null != locale && !locale.isEmpty()) { return getCurrentResourceBundle(LocaleUtils.toLocale(locale)); } } catch (IllegalArgumentException ex) { } return getCurrentResourceBundle((Locale) null); } }
ComponentUtil { public static ResourceBundle getCurrentResourceBundle(String locale) { try { if (null != locale && !locale.isEmpty()) { return getCurrentResourceBundle(LocaleUtils.toLocale(locale)); } } catch (IllegalArgumentException ex) { } return getCurrentResourceBundle((Locale) null); } private  ComponentUtil(); }
ComponentUtil { public static ResourceBundle getCurrentResourceBundle(String locale) { try { if (null != locale && !locale.isEmpty()) { return getCurrentResourceBundle(LocaleUtils.toLocale(locale)); } } catch (IllegalArgumentException ex) { } return getCurrentResourceBundle((Locale) null); } private  ComponentUtil(); static ResourceBundle getCurrentResourceBundle(String locale); static ResourceBundle getCurrentResourceBundle(Locale locale); }
ComponentUtil { public static ResourceBundle getCurrentResourceBundle(String locale) { try { if (null != locale && !locale.isEmpty()) { return getCurrentResourceBundle(LocaleUtils.toLocale(locale)); } } catch (IllegalArgumentException ex) { } return getCurrentResourceBundle((Locale) null); } private  ComponentUtil(); static ResourceBundle getCurrentResourceBundle(String locale); static ResourceBundle getCurrentResourceBundle(Locale locale);  }