réplica de
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-26 17:58:43 +02:00
26 líneas
698 B
Java
26 líneas
698 B
Java
|
|
import org.aspectj.testing.Tester;
|
|
|
|
/** @testcase VerifyError after around advice falls off end of tryCatch */
|
|
public class TryOffEnd {
|
|
public static void main(String[] args) {
|
|
Tester.check(new TryOffEnd().error(), "functional failure");
|
|
}
|
|
public boolean error() {
|
|
String s = null;
|
|
try {
|
|
s = System.getProperty("unknown Property");
|
|
} catch (Throwable t) { // CW 13 cannot apply advice
|
|
t.printStackTrace(System.err);
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
|
|
aspect A {
|
|
Object around() : within(TryOffEnd) && handler(Throwable) { // CW 21 cannot apply advice
|
|
Object result = proceed();
|
|
return result;
|
|
}
|
|
}
|