--- /dev/null
+public class Main {
+ public static void main(String[] args) {
+ try {
+ doit();
+ if (Trace.expectNoSuchMethodError) {
+ throw new RuntimeException("expected NoSuchMethodError");
+ }
+ } catch (NoSuchMethodError e) {
+ if (!Trace.expectNoSuchMethodError) throw e;
+ }
+
+ }
+
+ private static void doit() {
+ System.out.println("hello world");
+ }
+}
\ No newline at end of file
--- /dev/null
+aspect Trace {\r
+ public static boolean expectNoSuchMethodError = true;\r
+ \r
+ before(): execution(void main(..)) { // expect an error for incompatible binary change\r
+ System.out.println("enter");\r
+ }\r
+ \r
+ after() returning: execution(void doit(..)) {\r
+ System.out.println("exit");\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+aspect Trace {\r
+ public static boolean expectNoSuchMethodError = false;\r
+ \r
+ before(): execution(void doit(..)) {\r
+ System.out.println("enter");\r
+ }\r
+ \r
+ after() returning: execution(void doit(..)) {\r
+ System.out.println("exit");\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+aspect Trace {\r
+ public static boolean expectNoSuchMethodError = false;\r
+ \r
+ before(): execution(void doit(..)) {\r
+ System.out.println("entering");\r
+ }\r
+ \r
+ after() returning: execution(void doit(..)) {\r
+ System.out.println("exiting");\r
+ }\r
+}
\ No newline at end of file