aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs/SwitchInAround.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs/SwitchInAround.java')
-rw-r--r--tests/bugs/SwitchInAround.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/bugs/SwitchInAround.java b/tests/bugs/SwitchInAround.java
new file mode 100644
index 000000000..c86d71a3c
--- /dev/null
+++ b/tests/bugs/SwitchInAround.java
@@ -0,0 +1,27 @@
+import org.aspectj.testing.Tester;
+
+public class SwitchInAround {
+ public static void main(String[] args) {
+ SwitchInAround o = new SwitchInAround();
+ Tester.checkEqual(o.doit(1), "1");
+ Tester.checkEqual(o.doit(2), "2");
+ Tester.checkEqual(o.doit(3), "default");
+ }
+
+ public String doit(int i) {
+ return "doit";
+ }
+}
+
+privileged aspect A {
+ String around(int index): args(index) && call(String doit(int)) {
+ switch(index) {
+ case 1:
+ return "1";
+ case 2:
+ return "2";
+ default:
+ return "default";
+ }
+ }
+} \ No newline at end of file