mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-09-03 05:54:57 +02:00
29 lines
473 B
Plaintext
29 lines
473 B
Plaintext
import java.io.FileNotFoundException;
|
|
|
|
public aspect MethodCallInDiffClass {
|
|
|
|
pointcut p() : call(public * B1.m2());
|
|
|
|
before() throws FileNotFoundException : p() {
|
|
throw new FileNotFoundException();
|
|
}
|
|
|
|
}
|
|
|
|
class B {
|
|
|
|
public void m1() throws FileNotFoundException {
|
|
new B1().m2();
|
|
}
|
|
|
|
}
|
|
|
|
class B1 {
|
|
|
|
// don't want the 'declared exception not acutally
|
|
// thrown' warning since the advice is throwing it
|
|
public void m2() throws FileNotFoundException {
|
|
}
|
|
|
|
}
|