Better binary compatibility for advice method namestags/v_preCompileLoopAlteration
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"); | |||||
} | |||||
} |
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"); | |||||
} | |||||
} |
aspect Trace { | |||||
public static boolean expectNoSuchMethodError = false; | |||||
before(): execution(void doit(..)) { | |||||
System.out.println("enter"); | |||||
} | |||||
after() returning: execution(void doit(..)) { | |||||
System.out.println("exit"); | |||||
} | |||||
} |
aspect Trace { | |||||
public static boolean expectNoSuchMethodError = false; | |||||
before(): execution(void doit(..)) { | |||||
System.out.println("entering"); | |||||
} | |||||
after() returning: execution(void doit(..)) { | |||||
System.out.println("exiting"); | |||||
} | |||||
} |