From 8bc82cad05b8760aa5a01ffabaa6238b6cc535e1 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 19 Mar 2012 23:18:37 +0100 Subject: Fix for issue 342: @Deprecated annotation not propagated to generated getter/setter --- .../resource/after-delombok/GetterDeprecated.java | 18 ++++++++++++++++++ .../resource/after-delombok/SetterDeprecated.java | 18 ++++++++++++++++++ .../transform/resource/after-ecj/GetterDeprecated.java | 14 ++++++++++++++ .../transform/resource/after-ecj/SetterDeprecated.java | 14 ++++++++++++++ test/transform/resource/before/GetterDeprecated.java | 11 +++++++++++ test/transform/resource/before/SetterDeprecated.java | 11 +++++++++++ 6 files changed, 86 insertions(+) create mode 100644 test/transform/resource/after-delombok/GetterDeprecated.java create mode 100644 test/transform/resource/after-delombok/SetterDeprecated.java create mode 100644 test/transform/resource/after-ecj/GetterDeprecated.java create mode 100644 test/transform/resource/after-ecj/SetterDeprecated.java create mode 100644 test/transform/resource/before/GetterDeprecated.java create mode 100644 test/transform/resource/before/SetterDeprecated.java (limited to 'test/transform/resource') diff --git a/test/transform/resource/after-delombok/GetterDeprecated.java b/test/transform/resource/after-delombok/GetterDeprecated.java new file mode 100644 index 00000000..3387540f --- /dev/null +++ b/test/transform/resource/after-delombok/GetterDeprecated.java @@ -0,0 +1,18 @@ +class GetterDeprecated { + @Deprecated + int annotation; + /** + * @deprecated + */ + int javadoc; + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public int getAnnotation() { + return this.annotation; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public int getJavadoc() { + return this.javadoc; + } +} \ No newline at end of file diff --git a/test/transform/resource/after-delombok/SetterDeprecated.java b/test/transform/resource/after-delombok/SetterDeprecated.java new file mode 100644 index 00000000..5a6cf9f3 --- /dev/null +++ b/test/transform/resource/after-delombok/SetterDeprecated.java @@ -0,0 +1,18 @@ +class SetterDeprecated { + @Deprecated + int annotation; + /** + * @deprecated + */ + int javadoc; + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public void setAnnotation(final int annotation) { + this.annotation = annotation; + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public void setJavadoc(final int javadoc) { + this.javadoc = javadoc; + } +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/GetterDeprecated.java b/test/transform/resource/after-ecj/GetterDeprecated.java new file mode 100644 index 00000000..c19198dd --- /dev/null +++ b/test/transform/resource/after-ecj/GetterDeprecated.java @@ -0,0 +1,14 @@ +import lombok.Getter; +class GetterDeprecated { + @Deprecated @Getter int annotation; + @Getter int javadoc; + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") int getAnnotation() { + return this.annotation; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") int getJavadoc() { + return this.javadoc; + } + GetterDeprecated() { + super(); + } +} diff --git a/test/transform/resource/after-ecj/SetterDeprecated.java b/test/transform/resource/after-ecj/SetterDeprecated.java new file mode 100644 index 00000000..b12ae34d --- /dev/null +++ b/test/transform/resource/after-ecj/SetterDeprecated.java @@ -0,0 +1,14 @@ +import lombok.Setter; +class SetterDeprecated { + @Deprecated @Setter int annotation; + @Setter int javadoc; + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setAnnotation(final int annotation) { + this.annotation = annotation; + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void setJavadoc(final int javadoc) { + this.javadoc = javadoc; + } + SetterDeprecated() { + super(); + } +} diff --git a/test/transform/resource/before/GetterDeprecated.java b/test/transform/resource/before/GetterDeprecated.java new file mode 100644 index 00000000..01b66bca --- /dev/null +++ b/test/transform/resource/before/GetterDeprecated.java @@ -0,0 +1,11 @@ +import lombok.Getter; +class GetterDeprecated { + + @Deprecated + @Getter int annotation; + + /** + * @deprecated + */ + @Getter int javadoc; +} \ No newline at end of file diff --git a/test/transform/resource/before/SetterDeprecated.java b/test/transform/resource/before/SetterDeprecated.java new file mode 100644 index 00000000..e655622f --- /dev/null +++ b/test/transform/resource/before/SetterDeprecated.java @@ -0,0 +1,11 @@ +import lombok.Setter; +class SetterDeprecated { + + @Deprecated + @Setter int annotation; + + /** + * @deprecated + */ + @Setter int javadoc; +} \ No newline at end of file -- cgit