< prev index next >
test/java/util/ResourceBundle/modules/layer/src/m1/p/Main.java
Print this page
*** 31,45 ****
public static void main(String... args) {
run();
}
public static void run() {
! ClassLoader loader = Main.class.getModule().getLayer().findLoader("m1");
! ClassLoader loader2 = Main.class.getModule().getLayer().findLoader("m2");
! ResourceBundle bundle = ResourceBundle.getBundle("p.resources.MyResource", Locale.US);
! ResourceBundle bundle1 = ResourceBundle.getBundle("p.resources.MyResource", Locale.JAPANESE);
String enResult = bundle.getString("key");
String jaResult = bundle1.getString("key");
if (!"hi".equals(enResult) || !"ja".equals(jaResult)) {
throw new RuntimeException("Unexpected resources loaded: en: " +
--- 31,49 ----
public static void main(String... args) {
run();
}
public static void run() {
! ClassLoader loader =
! Main.class.getModule().getLayer().findLoader("m1");
! ClassLoader loader2 =
! Main.class.getModule().getLayer().findLoader("m2");
! ResourceBundle bundle =
! ResourceBundle.getBundle("p.resources.MyResource", Locale.US);
! ResourceBundle bundle1 =
! ResourceBundle.getBundle("p.resources.MyResource", Locale.JAPANESE);
String enResult = bundle.getString("key");
String jaResult = bundle1.getString("key");
if (!"hi".equals(enResult) || !"ja".equals(jaResult)) {
throw new RuntimeException("Unexpected resources loaded: en: " +
< prev index next >