aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs196
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2020-04-20 16:24:02 -0700
committerAndy Clement <aclement@pivotal.io>2020-04-20 16:24:02 -0700
commit4471ba76ac755b504d99e514a1cf5a375e7d02d1 (patch)
tree5f8d4f4dfb79d72f6c344294a319b0b04b01e2ae /tests/bugs196
parent17026e35243f229c2e3c07c292f2caaac65503a4 (diff)
downloadaspectj-4471ba76ac755b504d99e514a1cf5a375e7d02d1.tar.gz
aspectj-4471ba76ac755b504d99e514a1cf5a375e7d02d1.zip
Include JDTCore for Java14
Diffstat (limited to 'tests/bugs196')
-rw-r--r--tests/bugs196/java14/Jep305.java22
-rw-r--r--tests/bugs196/java14/Person.java2
-rw-r--r--tests/bugs196/java14/TraceRecordComponents.aj5
-rw-r--r--tests/bugs196/java14/UsingPersonRecord.java7
-rw-r--r--tests/bugs196/java14/p.java2
5 files changed, 38 insertions, 0 deletions
diff --git a/tests/bugs196/java14/Jep305.java b/tests/bugs196/java14/Jep305.java
new file mode 100644
index 000000000..3c526aef3
--- /dev/null
+++ b/tests/bugs196/java14/Jep305.java
@@ -0,0 +1,22 @@
+class Orange {
+ public String name1 = "orange";
+}
+
+class Apple {
+ public String name2 = "apple";
+}
+
+public class Jep305 {
+ public static void main(String []argv) {
+ print(new Orange());
+ print(new Apple());
+ }
+
+ public static void print(Object obj) {
+ if (obj instanceof Orange o) {
+ System.out.println(o.name1);
+ } else if (obj instanceof Apple a) {
+ System.out.println(a.name2);
+ }
+ }
+}
diff --git a/tests/bugs196/java14/Person.java b/tests/bugs196/java14/Person.java
new file mode 100644
index 000000000..a74932c83
--- /dev/null
+++ b/tests/bugs196/java14/Person.java
@@ -0,0 +1,2 @@
+public record Person(String firstName, String lastName, int age) {}
+
diff --git a/tests/bugs196/java14/TraceRecordComponents.aj b/tests/bugs196/java14/TraceRecordComponents.aj
new file mode 100644
index 000000000..80cc2444e
--- /dev/null
+++ b/tests/bugs196/java14/TraceRecordComponents.aj
@@ -0,0 +1,5 @@
+public aspect TraceRecordComponents {
+ before(): execution(public * *()) {
+ System.out.println(thisJoinPointStaticPart);
+ }
+}
diff --git a/tests/bugs196/java14/UsingPersonRecord.java b/tests/bugs196/java14/UsingPersonRecord.java
new file mode 100644
index 000000000..a974e9913
--- /dev/null
+++ b/tests/bugs196/java14/UsingPersonRecord.java
@@ -0,0 +1,7 @@
+public class UsingPersonRecord {
+ public static void main(String[] argv) {
+ Person p = new Person("A","B",99);
+ System.out.println(p);
+ System.out.println(p.firstName());
+ }
+}
diff --git a/tests/bugs196/java14/p.java b/tests/bugs196/java14/p.java
new file mode 100644
index 000000000..a74932c83
--- /dev/null
+++ b/tests/bugs196/java14/p.java
@@ -0,0 +1,2 @@
+public record Person(String firstName, String lastName, int age) {}
+