mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-13 23:55:51 +02:00
fcdafdbddb
NoSuchMethodError calling private method from around advice in inner aspect
25 lines
929 B
Java
25 lines
929 B
Java
package abc;
|
|
import def.*;
|
|
|
|
// This time, the around advice calls the private static method foo but the around advice
|
|
// will be inlined into a type in a different package (PrivateCall3). This should work
|
|
// as the around advice will call back to the aspect which will call on to foo().
|
|
|
|
public class PrivateCall_Instance_Package1 {
|
|
|
|
public void test () {foo("test");}
|
|
|
|
private void foo (String from) {
|
|
System.err.print(":"+from);
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
new PrivateCall_Instance_Package1().test();
|
|
}
|
|
|
|
private static aspect Aspect {
|
|
pointcut execTest (PrivateCall_Instance_Package2 o) : execution(* PrivateCall_Instance_Package2.test()) && target(o);
|
|
before (PrivateCall_Instance_Package2 o) : execTest (o) { new PrivateCall_Instance_Package1().foo("before"); }
|
|
void around (PrivateCall_Instance_Package2 o) : execTest (o) { new PrivateCall_Instance_Package1().foo("around"); }
|
|
}
|
|
} |