31 * @run main BootstrapRedefine
32 */
33
34 import jdk.test.lib.*;
35
36 public class BootstrapRedefine {
37
38 public static void main(String[] args) throws Exception {
39 String source = "package java.lang;" +
40 "public class Object {" +
41 " void dummy1() { return; }" +
42 " void dummy2() { return; }" +
43 " void dummy3() { return; }" +
44 "}";
45
46 ClassFileInstaller.writeClassToDisk("java/lang/Object",
47 InMemoryJavaCompiler.compile("java.lang.Object", source,
48 "-Xmodule:java.base"),
49 "mods/java.base");
50
51 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xpatch:java.base=mods/java.base", "-version");
52 new OutputAnalyzer(pb.start())
53 .shouldContain("Incompatible definition of java.lang.Object")
54 .shouldHaveExitValue(1);
55 }
56 }
|
31 * @run main BootstrapRedefine
32 */
33
34 import jdk.test.lib.*;
35
36 public class BootstrapRedefine {
37
38 public static void main(String[] args) throws Exception {
39 String source = "package java.lang;" +
40 "public class Object {" +
41 " void dummy1() { return; }" +
42 " void dummy2() { return; }" +
43 " void dummy3() { return; }" +
44 "}";
45
46 ClassFileInstaller.writeClassToDisk("java/lang/Object",
47 InMemoryJavaCompiler.compile("java.lang.Object", source,
48 "-Xmodule:java.base"),
49 "mods/java.base");
50
51 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("--patch-module=java.base=mods/java.base", "-version");
52 new OutputAnalyzer(pb.start())
53 .shouldContain("Incompatible definition of java.lang.Object")
54 .shouldHaveExitValue(1);
55 }
56 }
|