aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features193
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2019-04-03 10:23:44 -0700
committerAndy Clement <aclement@pivotal.io>2019-04-03 10:23:44 -0700
commit0e2c95a36900fe913f5d768e7f4632034ddf005b (patch)
treef7f1bb92dfbae87de0a8998491e863490984aa0a /tests/features193
parentdbb2c59fcfa6837f1fde9e0c1f0d04751c9268ee (diff)
downloadaspectj-0e2c95a36900fe913f5d768e7f4632034ddf005b.tar.gz
aspectj-0e2c95a36900fe913f5d768e7f4632034ddf005b.zip
Updated with Java12 support
Diffstat (limited to 'tests/features193')
-rw-r--r--tests/features193/Switch1.java22
-rw-r--r--tests/features193/Switch2.java28
-rw-r--r--tests/features193/Switch3.java32
3 files changed, 82 insertions, 0 deletions
diff --git a/tests/features193/Switch1.java b/tests/features193/Switch1.java
new file mode 100644
index 000000000..1daeeff6f
--- /dev/null
+++ b/tests/features193/Switch1.java
@@ -0,0 +1,22 @@
+public class Switch1 {
+ public static void main(String[] argv) {
+ System.out.println(one(Color.R));
+ System.out.println(one(Color.G));
+ System.out.println(one(Color.B));
+ System.out.println(one(Color.Y));
+ }
+
+ public static int one(Color color) {
+ int result = switch(color) {
+ case R -> 0;
+ case G -> 1;
+ case B -> 2;
+ default -> 3;
+ };
+ return result;
+ }
+}
+
+enum Color {
+ R, G, B, Y;
+} \ No newline at end of file
diff --git a/tests/features193/Switch2.java b/tests/features193/Switch2.java
new file mode 100644
index 000000000..c4acc82d9
--- /dev/null
+++ b/tests/features193/Switch2.java
@@ -0,0 +1,28 @@
+public class Switch2 {
+ public static void main(String[] argv) {
+ System.out.println(one(Color.R));
+ System.out.println(one(Color.G));
+ System.out.println(one(Color.B));
+ System.out.println(one(Color.Y));
+ }
+
+ public static int one(Color color) {
+ int result = switch(color) {
+ case R -> 0;
+ case G -> 1;
+ case B -> 2;
+ default -> 3;
+ };
+ return result;
+ }
+}
+
+enum Color {
+ R, G, B, Y;
+}
+
+aspect X {
+ int around(): call(* one(..)) {
+ return proceed()*2;
+ }
+} \ No newline at end of file
diff --git a/tests/features193/Switch3.java b/tests/features193/Switch3.java
new file mode 100644
index 000000000..a99622d75
--- /dev/null
+++ b/tests/features193/Switch3.java
@@ -0,0 +1,32 @@
+public class Switch3 {
+ public static void main(String[] argv) {
+ System.out.println(one(Color.R));
+ System.out.println(one(Color.G));
+ System.out.println(one(Color.B));
+ System.out.println(one(Color.Y));
+ }
+
+ public static int one(Color color) {
+ int result = switch(color) {
+ case R -> foo(0);
+ case G -> foo(1);
+ case B -> foo(2);
+ default -> foo(3);
+ };
+ return result;
+ }
+
+ public static final int foo(int i) {
+ return i+1;
+ }
+}
+
+enum Color {
+ R, G, B, Y;
+}
+
+aspect X {
+ int around(): call(* foo(..)) {
+ return proceed()*3;
+ }
+} \ No newline at end of file