From c809047b7892e4729f892445f730dff1d21065d6 Mon Sep 17 00:00:00 2001 From: Taiki Sugawara Date: Wed, 22 Feb 2012 05:01:35 +0900 Subject: support delegate with deprecated comment. --- .../after-delombok/DelegateWithDeprecated.java | 29 ++++++++++++++++++++++ .../resource/after-ecj/DelegateWithDeprecated.java | 29 ++++++++++++++++++++++ .../resource/before/DelegateWithDeprecated.java | 13 ++++++++++ 3 files changed, 71 insertions(+) create mode 100644 test/transform/resource/after-delombok/DelegateWithDeprecated.java create mode 100644 test/transform/resource/after-ecj/DelegateWithDeprecated.java create mode 100644 test/transform/resource/before/DelegateWithDeprecated.java (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/DelegateWithDeprecated.java b/test/transform/resource/after-delombok/DelegateWithDeprecated.java new file mode 100644 index 00000000..011eaf36 --- /dev/null +++ b/test/transform/resource/after-delombok/DelegateWithDeprecated.java @@ -0,0 +1,29 @@ +class DelegateWithDeprecated { + + private Bar bar; + + private interface Bar { + + @Deprecated + void deprecatedAnnotation(); + /** @deprecated */ + void deprecatedComment(); + + void notDeprecated(); + } + + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public void deprecatedAnnotation() { + this.bar.deprecatedAnnotation(); + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public void deprecatedComment() { + this.bar.deprecatedComment(); + } + @java.lang.SuppressWarnings("all") + public void notDeprecated() { + this.bar.notDeprecated(); + } +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/DelegateWithDeprecated.java b/test/transform/resource/after-ecj/DelegateWithDeprecated.java new file mode 100644 index 00000000..011eaf36 --- /dev/null +++ b/test/transform/resource/after-ecj/DelegateWithDeprecated.java @@ -0,0 +1,29 @@ +class DelegateWithDeprecated { + + private Bar bar; + + private interface Bar { + + @Deprecated + void deprecatedAnnotation(); + /** @deprecated */ + void deprecatedComment(); + + void notDeprecated(); + } + + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public void deprecatedAnnotation() { + this.bar.deprecatedAnnotation(); + } + @java.lang.Deprecated + @java.lang.SuppressWarnings("all") + public void deprecatedComment() { + this.bar.deprecatedComment(); + } + @java.lang.SuppressWarnings("all") + public void notDeprecated() { + this.bar.notDeprecated(); + } +} \ No newline at end of file diff --git a/test/transform/resource/before/DelegateWithDeprecated.java b/test/transform/resource/before/DelegateWithDeprecated.java new file mode 100644 index 00000000..b748c6ec --- /dev/null +++ b/test/transform/resource/before/DelegateWithDeprecated.java @@ -0,0 +1,13 @@ +import lombok.Delegate; + +class DelegateWithDeprecated { + @Delegate private Bar bar; + + private interface Bar { + @Deprecated + void deprecatedAnnotation(); + /** @deprecated */ + void deprecatedComment(); + void notDeprecated(); + } +} \ No newline at end of file -- cgit From c63d036e78790a6bd4750d778effe2a63914dbaa Mon Sep 17 00:00:00 2001 From: Taiki Sugawara Date: Fri, 24 Feb 2012 22:56:42 +0900 Subject: Remove spaces in after files. --- test/transform/resource/after-delombok/DelegateWithDeprecated.java | 5 ----- test/transform/resource/after-ecj/DelegateWithDeprecated.java | 5 ----- 2 files changed, 10 deletions(-) (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/DelegateWithDeprecated.java b/test/transform/resource/after-delombok/DelegateWithDeprecated.java index 011eaf36..04e12160 100644 --- a/test/transform/resource/after-delombok/DelegateWithDeprecated.java +++ b/test/transform/resource/after-delombok/DelegateWithDeprecated.java @@ -1,17 +1,12 @@ class DelegateWithDeprecated { - private Bar bar; - private interface Bar { - @Deprecated void deprecatedAnnotation(); /** @deprecated */ void deprecatedComment(); - void notDeprecated(); } - @java.lang.Deprecated @java.lang.SuppressWarnings("all") public void deprecatedAnnotation() { diff --git a/test/transform/resource/after-ecj/DelegateWithDeprecated.java b/test/transform/resource/after-ecj/DelegateWithDeprecated.java index 011eaf36..04e12160 100644 --- a/test/transform/resource/after-ecj/DelegateWithDeprecated.java +++ b/test/transform/resource/after-ecj/DelegateWithDeprecated.java @@ -1,17 +1,12 @@ class DelegateWithDeprecated { - private Bar bar; - private interface Bar { - @Deprecated void deprecatedAnnotation(); /** @deprecated */ void deprecatedComment(); - void notDeprecated(); } - @java.lang.Deprecated @java.lang.SuppressWarnings("all") public void deprecatedAnnotation() { -- cgit From 821370e01b1c1878c36da81c5baa93bf1dd5c973 Mon Sep 17 00:00:00 2001 From: Taiki Sugawara Date: Fri, 24 Feb 2012 23:55:02 +0900 Subject: Add deprecated comment support for eclipse. --- .../lombok/eclipse/agent/PatchDelegate.java | 2 +- .../resource/after-ecj/DelegateWithDeprecated.java | 41 ++++++++++------------ 2 files changed, 20 insertions(+), 23 deletions(-) (limited to 'test/transform') diff --git a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java index 87335b4e..6977df2b 100644 --- a/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java +++ b/src/eclipseAgent/lombok/eclipse/agent/PatchDelegate.java @@ -581,7 +581,7 @@ public class PatchDelegate { method.modifiers = ClassFileConstants.AccPublic; method.returnType = makeType(binding.returnType, source, false); - boolean isDeprecated = hasDeprecatedAnnotation(binding); + boolean isDeprecated = hasDeprecatedAnnotation(binding) || binding.isDeprecated(); method.selector = binding.selector; diff --git a/test/transform/resource/after-ecj/DelegateWithDeprecated.java b/test/transform/resource/after-ecj/DelegateWithDeprecated.java index 04e12160..2a4fdf98 100644 --- a/test/transform/resource/after-ecj/DelegateWithDeprecated.java +++ b/test/transform/resource/after-ecj/DelegateWithDeprecated.java @@ -1,24 +1,21 @@ +import lombok.Delegate; class DelegateWithDeprecated { - private Bar bar; - private interface Bar { - @Deprecated - void deprecatedAnnotation(); - /** @deprecated */ - void deprecatedComment(); - void notDeprecated(); - } - @java.lang.Deprecated - @java.lang.SuppressWarnings("all") - public void deprecatedAnnotation() { - this.bar.deprecatedAnnotation(); - } - @java.lang.Deprecated - @java.lang.SuppressWarnings("all") - public void deprecatedComment() { - this.bar.deprecatedComment(); - } - @java.lang.SuppressWarnings("all") - public void notDeprecated() { - this.bar.notDeprecated(); - } + private interface Bar { + @Deprecated void deprecatedAnnotation(); + void deprecatedComment(); + void notDeprecated(); + } + private @Delegate Bar bar; + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void deprecatedAnnotation() { + this.bar.deprecatedAnnotation(); + } + public @java.lang.Deprecated @java.lang.SuppressWarnings("all") void deprecatedComment() { + this.bar.deprecatedComment(); + } + public @java.lang.SuppressWarnings("all") void notDeprecated() { + this.bar.notDeprecated(); + } + DelegateWithDeprecated() { + super(); + } } \ No newline at end of file -- cgit