Better binary compatibility for advice method namestags/v_preCompileLoopAlteration
@@ -0,0 +1,17 @@ | |||
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"); | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
aspect Trace { | |||
public static boolean expectNoSuchMethodError = true; | |||
before(): execution(void main(..)) { // expect an error for incompatible binary change | |||
System.out.println("enter"); | |||
} | |||
after() returning: execution(void doit(..)) { | |||
System.out.println("exit"); | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
aspect Trace { | |||
public static boolean expectNoSuchMethodError = false; | |||
before(): execution(void doit(..)) { | |||
System.out.println("enter"); | |||
} | |||
after() returning: execution(void doit(..)) { | |||
System.out.println("exit"); | |||
} | |||
} |
@@ -0,0 +1,11 @@ | |||
aspect Trace { | |||
public static boolean expectNoSuchMethodError = false; | |||
before(): execution(void doit(..)) { | |||
System.out.println("entering"); | |||
} | |||
after() returning: execution(void doit(..)) { | |||
System.out.println("exiting"); | |||
} | |||
} |