mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-03 05:54:57 +02:00
41 lines
726 B
Plaintext
41 lines
726 B
Plaintext
import java.io.FileNotFoundException;
|
|
|
|
aspect InnerMethodCall2 {
|
|
|
|
pointcut p() : call(* C1.c1Method());
|
|
|
|
before() throws FileNotFoundException : p() {
|
|
throw new FileNotFoundException();
|
|
}
|
|
|
|
}
|
|
|
|
class MainClass {
|
|
|
|
public void amethod() {
|
|
new C() {
|
|
public void mymethod() throws FileNotFoundException {
|
|
new C() {
|
|
public void mymethod() throws FileNotFoundException {
|
|
new C1().c1Method();
|
|
}
|
|
};
|
|
}
|
|
};
|
|
}
|
|
|
|
}
|
|
|
|
class C1 {
|
|
|
|
// don't want the 'declared exception not actually thrown'
|
|
// exception because the advice is effectively throwing it
|
|
public void c1Method() throws FileNotFoundException {
|
|
}
|
|
|
|
}
|
|
|
|
abstract class C {
|
|
public abstract void mymethod() throws FileNotFoundException;
|
|
}
|