aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2017-03-06 23:34:23 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2017-03-07 01:12:24 +0100
commitd05d03743316e45abfd0d00397999d7eb959eb64 (patch)
treebfccd4cc021b83355e49fab83120e8f93e458d69 /test/transform/resource
parent8bfbd7fa846537c9393350e02c459c6878c0dec2 (diff)
downloadlombok-d05d03743316e45abfd0d00397999d7eb959eb64.tar.gz
lombok-d05d03743316e45abfd0d00397999d7eb959eb64.tar.bz2
lombok-d05d03743316e45abfd0d00397999d7eb959eb64.zip
Fixed issue #778: problems with onX if the annotation to be added has named args.
Diffstat (limited to 'test/transform/resource')
-rw-r--r--test/transform/resource/after-delombok/OnXJava7Style.java43
-rw-r--r--test/transform/resource/after-delombok/OnXJava8Style.java43
-rw-r--r--test/transform/resource/after-ecj/OnXJava7Style.java31
-rw-r--r--test/transform/resource/after-ecj/OnXJava7StyleOn8.java31
-rw-r--r--test/transform/resource/after-ecj/OnXJava8Style.java31
-rw-r--r--test/transform/resource/after-ecj/OnXJava8StyleOn7.java31
-rw-r--r--test/transform/resource/before/GetterOnMethodErrors2.java1
-rw-r--r--test/transform/resource/before/OnXJava7Style.java16
-rw-r--r--test/transform/resource/before/OnXJava7StyleOn8.java18
-rw-r--r--test/transform/resource/before/OnXJava8Style.java16
-rw-r--r--test/transform/resource/before/OnXJava8StyleOn7.java18
-rw-r--r--test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages8
-rw-r--r--test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages8
13 files changed, 287 insertions, 8 deletions
diff --git a/test/transform/resource/after-delombok/OnXJava7Style.java b/test/transform/resource/after-delombok/OnXJava7Style.java
new file mode 100644
index 00000000..f3a58d79
--- /dev/null
+++ b/test/transform/resource/after-delombok/OnXJava7Style.java
@@ -0,0 +1,43 @@
+//version :7
+public class OnXJava7Style {
+ @interface Foo {
+ String value() default "";
+ }
+ @interface Bar {
+ String stuff() default "";
+ }
+ String a;
+ String b;
+ String c;
+ String d;
+ String e;
+ @Foo
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public String getA() {
+ return this.a;
+ }
+ @Foo
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public void setB(final String b) {
+ this.b = b;
+ }
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public void setC(@Foo("a") final String c) {
+ this.c = c;
+ }
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public void setD(@Bar(stuff = "b") final String d) {
+ this.d = d;
+ }
+ @Foo("c")
+ @Bar(stuff = "d")
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public String getE() {
+ return this.e;
+ }
+}
diff --git a/test/transform/resource/after-delombok/OnXJava8Style.java b/test/transform/resource/after-delombok/OnXJava8Style.java
new file mode 100644
index 00000000..b0ea96d6
--- /dev/null
+++ b/test/transform/resource/after-delombok/OnXJava8Style.java
@@ -0,0 +1,43 @@
+//version 8:
+public class OnXJava8Style {
+ @interface Foo {
+ String value() default "";
+ }
+ @interface Bar {
+ String stuff() default "";
+ }
+ String a;
+ String b;
+ String c;
+ String d;
+ String e;
+ @Foo
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public String getA() {
+ return this.a;
+ }
+ @Foo
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public void setB(final String b) {
+ this.b = b;
+ }
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public void setC(@Foo("a") final String c) {
+ this.c = c;
+ }
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public void setD(@Bar(stuff = "b") final String d) {
+ this.d = d;
+ }
+ @Foo("c")
+ @Bar(stuff = "d")
+ @java.lang.SuppressWarnings("all")
+ @javax.annotation.Generated("lombok")
+ public String getE() {
+ return this.e;
+ }
+}
diff --git a/test/transform/resource/after-ecj/OnXJava7Style.java b/test/transform/resource/after-ecj/OnXJava7Style.java
new file mode 100644
index 00000000..415234d8
--- /dev/null
+++ b/test/transform/resource/after-ecj/OnXJava7Style.java
@@ -0,0 +1,31 @@
+public class OnXJava7Style {
+ @interface Foo {
+ String value() default "";
+ }
+ @interface Bar {
+ String stuff() default "";
+ }
+ @lombok.Getter() String a;
+ @lombok.Setter() String b;
+ @lombok.Setter() String c;
+ @lombok.Setter() String d;
+ @lombok.Getter() String e;
+ public OnXJava7Style() {
+ super();
+ }
+ public @Foo @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getA() {
+ return this.a;
+ }
+ public @Foo() @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setB(final String b) {
+ this.b = b;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setC(final @Foo("a") String c) {
+ this.c = c;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setD(final @Bar(stuff = "b") String d) {
+ this.d = d;
+ }
+ public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getE() {
+ return this.e;
+ }
+}
diff --git a/test/transform/resource/after-ecj/OnXJava7StyleOn8.java b/test/transform/resource/after-ecj/OnXJava7StyleOn8.java
new file mode 100644
index 00000000..da51a5f0
--- /dev/null
+++ b/test/transform/resource/after-ecj/OnXJava7StyleOn8.java
@@ -0,0 +1,31 @@
+public class OnXJava7StyleOn8 {
+ @interface Foo {
+ String value() default "";
+ }
+ @interface Bar {
+ String stuff() default "";
+ }
+ @lombok.Getter() String a;
+ @lombok.Setter() String b;
+ @lombok.Setter() String c;
+ @lombok.Setter() String d;
+ @lombok.Getter() String e;
+ public OnXJava7StyleOn8() {
+ super();
+ }
+ public @Foo @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getA() {
+ return this.a;
+ }
+ public @Foo() @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setB(final String b) {
+ this.b = b;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setC(final @Foo("a") String c) {
+ this.c = c;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setD(final @Bar(stuff = "b") String d) {
+ this.d = d;
+ }
+ public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getE() {
+ return this.e;
+ }
+}
diff --git a/test/transform/resource/after-ecj/OnXJava8Style.java b/test/transform/resource/after-ecj/OnXJava8Style.java
new file mode 100644
index 00000000..0e95a20b
--- /dev/null
+++ b/test/transform/resource/after-ecj/OnXJava8Style.java
@@ -0,0 +1,31 @@
+public class OnXJava8Style {
+ @interface Foo {
+ String value() default "";
+ }
+ @interface Bar {
+ String stuff() default "";
+ }
+ @lombok.Getter() String a;
+ @lombok.Setter() String b;
+ @lombok.Setter() String c;
+ @lombok.Setter() String d;
+ @lombok.Getter() String e;
+ public OnXJava8Style() {
+ super();
+ }
+ public @Foo @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getA() {
+ return this.a;
+ }
+ public @Foo() @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setB(final String b) {
+ this.b = b;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setC(final @Foo("a") String c) {
+ this.c = c;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setD(final @Bar(stuff = "b") String d) {
+ this.d = d;
+ }
+ public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getE() {
+ return this.e;
+ }
+}
diff --git a/test/transform/resource/after-ecj/OnXJava8StyleOn7.java b/test/transform/resource/after-ecj/OnXJava8StyleOn7.java
new file mode 100644
index 00000000..28afb5a7
--- /dev/null
+++ b/test/transform/resource/after-ecj/OnXJava8StyleOn7.java
@@ -0,0 +1,31 @@
+public class OnXJava8StyleOn7 {
+ @interface Foo {
+ String value() default "";
+ }
+ @interface Bar {
+ String stuff() default "";
+ }
+ @lombok.Getter() String a;
+ @lombok.Setter() String b;
+ @lombok.Setter() String c;
+ @lombok.Setter() String d;
+ @lombok.Getter() String e;
+ public OnXJava8StyleOn7() {
+ super();
+ }
+ public @Foo @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getA() {
+ return this.a;
+ }
+ public @Foo() @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setB(final String b) {
+ this.b = b;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setC(final @Foo("a") String c) {
+ this.c = c;
+ }
+ public @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") void setD(final @Bar(stuff = "b") String d) {
+ this.d = d;
+ }
+ public @Foo(value = "c") @Bar(stuff = "d") @java.lang.SuppressWarnings("all") @javax.annotation.Generated("lombok") String getE() {
+ return this.e;
+ }
+}
diff --git a/test/transform/resource/before/GetterOnMethodErrors2.java b/test/transform/resource/before/GetterOnMethodErrors2.java
index 2fd98c83..08ef13c6 100644
--- a/test/transform/resource/before/GetterOnMethodErrors2.java
+++ b/test/transform/resource/before/GetterOnMethodErrors2.java
@@ -1,3 +1,4 @@
+//version 8:
class GetterOnMethodErrors2 {
@lombok.Getter(onMethod=@_A_(@Deprecated)) private int bad1;
@lombok.Getter(onMethod=@__(5)) private int bad2;
diff --git a/test/transform/resource/before/OnXJava7Style.java b/test/transform/resource/before/OnXJava7Style.java
new file mode 100644
index 00000000..6a3c35ff
--- /dev/null
+++ b/test/transform/resource/before/OnXJava7Style.java
@@ -0,0 +1,16 @@
+//version :7
+public class OnXJava7Style {
+ @interface Foo {
+ String value() default "";
+ }
+
+ @interface Bar {
+ String stuff() default "";
+ }
+
+ @lombok.Getter(onMethod=@__(@Foo)) String a;
+ @lombok.Setter(onMethod=@__(@Foo())) String b;
+ @lombok.Setter(onParam=@__(@Foo("a"))) String c;
+ @lombok.Setter(onParam=@__(@Bar(stuff="b"))) String d;
+ @lombok.Getter(onMethod=@__({@Foo(value="c"), @Bar(stuff="d")})) String e;
+}
diff --git a/test/transform/resource/before/OnXJava7StyleOn8.java b/test/transform/resource/before/OnXJava7StyleOn8.java
new file mode 100644
index 00000000..582fe6ce
--- /dev/null
+++ b/test/transform/resource/before/OnXJava7StyleOn8.java
@@ -0,0 +1,18 @@
+//platform ecj
+//version 8:
+
+public class OnXJava7StyleOn8 {
+ @interface Foo {
+ String value() default "";
+ }
+
+ @interface Bar {
+ String stuff() default "";
+ }
+
+ @lombok.Getter(onMethod=@__(@Foo)) String a;
+ @lombok.Setter(onMethod=@__(@Foo())) String b;
+ @lombok.Setter(onParam=@__(@Foo("a"))) String c;
+ @lombok.Setter(onParam=@__(@Bar(stuff="b"))) String d;
+ @lombok.Getter(onMethod=@__({@Foo(value="c"), @Bar(stuff="d")})) String e;
+}
diff --git a/test/transform/resource/before/OnXJava8Style.java b/test/transform/resource/before/OnXJava8Style.java
new file mode 100644
index 00000000..ffb91727
--- /dev/null
+++ b/test/transform/resource/before/OnXJava8Style.java
@@ -0,0 +1,16 @@
+//version 8:
+public class OnXJava8Style {
+ @interface Foo {
+ String value() default "";
+ }
+
+ @interface Bar {
+ String stuff() default "";
+ }
+
+ @lombok.Getter(onMethod_=@Foo) String a;
+ @lombok.Setter(onMethod_=@Foo()) String b;
+ @lombok.Setter(onParam_=@Foo("a")) String c;
+ @lombok.Setter(onParam_=@Bar(stuff="b")) String d;
+ @lombok.Getter(onMethod_={@Foo(value="c"), @Bar(stuff="d")}) String e;
+}
diff --git a/test/transform/resource/before/OnXJava8StyleOn7.java b/test/transform/resource/before/OnXJava8StyleOn7.java
new file mode 100644
index 00000000..c006e468
--- /dev/null
+++ b/test/transform/resource/before/OnXJava8StyleOn7.java
@@ -0,0 +1,18 @@
+//platform ecj
+//version :7
+
+public class OnXJava8StyleOn7 {
+ @interface Foo {
+ String value() default "";
+ }
+
+ @interface Bar {
+ String stuff() default "";
+ }
+
+ @lombok.Getter(onMethod_=@Foo) String a;
+ @lombok.Setter(onMethod_=@Foo()) String b;
+ @lombok.Setter(onParam_=@Foo("a")) String c;
+ @lombok.Setter(onParam_=@Bar(stuff="b")) String d;
+ @lombok.Getter(onMethod_={@Foo(value="c"), @Bar(stuff="d")}) String e;
+}
diff --git a/test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages b/test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages
index 53a9b9ad..6a181265 100644
--- a/test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages
+++ b/test/transform/resource/messages-delombok/GetterOnMethodErrors2.java.messages
@@ -1,4 +1,4 @@
-2 The correct format is @Getter(onMethod=@__({@SomeAnnotation, @SomeOtherAnnotation}))
-3 The correct format is @Getter(onMethod=@__({@SomeAnnotation, @SomeOtherAnnotation}))
-4 The correct format is @Getter(onMethod=@__({@SomeAnnotation, @SomeOtherAnnotation}))
-5 The correct format is @Getter(onMethod=@__({@SomeAnnotation, @SomeOtherAnnotation}))
+2 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation})
+3 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation})
+4 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation})
+5 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation})
diff --git a/test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages b/test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages
index 53a9b9ad..6a181265 100644
--- a/test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages
+++ b/test/transform/resource/messages-ecj/GetterOnMethodErrors2.java.messages
@@ -1,4 +1,4 @@
-2 The correct format is @Getter(onMethod=@__({@SomeAnnotation, @SomeOtherAnnotation}))
-3 The correct format is @Getter(onMethod=@__({@SomeAnnotation, @SomeOtherAnnotation}))
-4 The correct format is @Getter(onMethod=@__({@SomeAnnotation, @SomeOtherAnnotation}))
-5 The correct format is @Getter(onMethod=@__({@SomeAnnotation, @SomeOtherAnnotation}))
+2 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation})
+3 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation})
+4 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation})
+5 The correct format is @Getter(onMethod_={@SomeAnnotation, @SomeOtherAnnotation})