(String name, Locale locale,
ClassLoader loader)
| 63 | } |
| 64 | |
| 65 | public static ResourceBundle getBundle(String name, Locale locale, |
| 66 | ClassLoader loader) |
| 67 | { |
| 68 | try { |
| 69 | ResourceBundle b = find(name, loader, null); |
| 70 | |
| 71 | if (locale.getLanguage() != null) { |
| 72 | name = name + "_" + locale.getLanguage(); |
| 73 | ResourceBundle b2 = find(name, loader, b); |
| 74 | if (b2 != null) b = b2; |
| 75 | |
| 76 | if (locale.getCountry() != null) { |
| 77 | name = name + "_" + locale.getCountry(); |
| 78 | b2 = find(name, loader, b); |
| 79 | if (b2 != null) b = b2; |
| 80 | |
| 81 | if (locale.getVariant() != null) { |
| 82 | name = name + "_" + locale.getVariant(); |
| 83 | b2 = find(name, loader, b); |
| 84 | if (b2 != null) b = b2; |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | return b; |
| 89 | } catch (Exception e) { |
| 90 | RuntimeException re = new MissingResourceException(name, name, null); |
| 91 | re.initCause(e); |
| 92 | throw re; |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | public static ResourceBundle getBundle(String name, Locale locale) { |
| 97 | return getBundle(name, locale, Method.getCaller().class_.loader); |
nothing calls this directly
no test coverage detected