jdk/test/java/lang/Class/forName/modules/src/m2/p2/test/Main.java
changeset 42338 a60f280f803c
parent 36511 9d0388c6b336
child 44545 83b611b88ac8
equal deleted inserted replaced
42148:7a4a59859ac0 42338:a60f280f803c
    42         findClass(loader.getUnnamedModule(), "TestDriver");
    42         findClass(loader.getUnnamedModule(), "TestDriver");
    43 
    43 
    44         try {
    44         try {
    45             Class<?> c = findClass(m1, "p1.internal.B");
    45             Class<?> c = findClass(m1, "p1.internal.B");
    46             c.newInstance();
    46             c.newInstance();
    47             throw new RuntimeException(c.getName() + " is not exported to m2");
    47             throw new RuntimeException(c.getName() + " should not be exported to m2");
    48         } catch (IllegalAccessException e) {}
    48         } catch (IllegalAccessException e) {}
    49     }
    49     }
    50 
    50 
    51     static Class<?> findClass(Module module, String cn) {
    51     static Class<?> findClass(Module module, String cn) {
    52         Class<?> c = Class.forName(module, cn);
    52         Class<?> c = Class.forName(module, cn);