mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-14 14:11:27 +02:00
29 lines
554 B
Java
29 lines
554 B
Java
import org.aspectj.testing.Tester;
|
|
|
|
public class FinallyAndReturns {
|
|
public static void main(String[] args) {
|
|
Tester.checkEqual(m(), "hi");
|
|
Tester.check("finally");
|
|
|
|
Tester.checkEqual(m1(), "hi1");
|
|
Tester.check("trying");
|
|
}
|
|
|
|
public static String m() {
|
|
try {
|
|
return "hi";
|
|
} finally {
|
|
Tester.note("finally");
|
|
}
|
|
}
|
|
|
|
public static String m1() {
|
|
try {
|
|
Tester.note("trying");
|
|
} finally {
|
|
return "hi1";
|
|
}
|
|
}
|
|
|
|
}
|