aboutsummaryrefslogtreecommitdiff
path: root/test/pretty/resource
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-01-29 03:07:21 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2020-01-29 03:07:21 +0100
commit229cde2bf084e243913030ddad4bce13f6c38732 (patch)
tree2a211dfec7a570f50ff83971b323bf3a933f3db3 /test/pretty/resource
parente95680a76733c22ee5937a586ee50c703d5ba621 (diff)
downloadlombok-229cde2bf084e243913030ddad4bce13f6c38732.tar.gz
lombok-229cde2bf084e243913030ddad4bce13f6c38732.tar.bz2
lombok-229cde2bf084e243913030ddad4bce13f6c38732.zip
[Fixes #2349] Support for JDK 14
Added the ability to parse and pretty-print the new 'x instanceof String y' pattern concept. Added a test to the pretty printer to confirm that it works.
Diffstat (limited to 'test/pretty/resource')
-rw-r--r--test/pretty/resource/after/PatternInstanceOf.java7
-rw-r--r--test/pretty/resource/before/PatternInstanceOf.java8
2 files changed, 15 insertions, 0 deletions
diff --git a/test/pretty/resource/after/PatternInstanceOf.java b/test/pretty/resource/after/PatternInstanceOf.java
new file mode 100644
index 00000000..3fcba749
--- /dev/null
+++ b/test/pretty/resource/after/PatternInstanceOf.java
@@ -0,0 +1,7 @@
+public class PatternInstanceOf {
+ public void foo(Object o) {
+ if (o instanceof String y) {
+ System.out.println(y);
+ }
+ }
+}
diff --git a/test/pretty/resource/before/PatternInstanceOf.java b/test/pretty/resource/before/PatternInstanceOf.java
new file mode 100644
index 00000000..c957adeb
--- /dev/null
+++ b/test/pretty/resource/before/PatternInstanceOf.java
@@ -0,0 +1,8 @@
+// version 14:
+public class PatternInstanceOf {
+ public void foo(Object o) {
+ if (o instanceof String y) {
+ System.out.println(y);
+ }
+ }
+}