49 return Thing1.getThingNumber(); |
49 return Thing1.getThingNumber(); |
50 } |
50 } |
51 }; |
51 }; |
52 |
52 |
53 public static void main(String... args) throws Exception { |
53 public static void main(String... args) throws Exception { |
54 Thing1Handler.getThingNumber(); |
54 int x = Thing1Handler.getThingNumber(); |
|
55 System.out.println("ThingNumber: "+Integer.toString(x)); |
55 } |
56 } |
56 } |
57 } |
57 |
58 |
58 public static void main(String... args) throws Exception { |
59 public static void main(String... args) throws Exception { |
59 |
60 |
60 // (1) classresolve should turn on. |
61 // (1) classresolve should turn on. |
61 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug", |
62 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug", |
62 ClassResolutionTestMain.class.getName()); |
63 ClassResolutionTestMain.class.getName()); |
63 OutputAnalyzer o = new OutputAnalyzer(pb.start()); |
64 OutputAnalyzer o = new OutputAnalyzer(pb.start()); |
64 o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); |
65 o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); |
|
66 o.shouldContain("[classresolve] resolve JVM_CONSTANT_MethodHandle"); |
65 |
67 |
66 // (2) classresolve should turn off. |
68 // (2) classresolve should turn off. |
67 pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug", |
69 pb = ProcessTools.createJavaProcessBuilder("-Xlog:classresolve=debug", |
68 "-Xlog:classresolve=off", |
70 "-Xlog:classresolve=off", |
69 ClassResolutionTestMain.class.getName()); |
71 ClassResolutionTestMain.class.getName()); |