From 867929c79f344e2fa63aa280cf452d39eb7aabf7 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 8 Jul 2013 06:06:49 +0200 Subject: added tests for new javadoc behaviour, javac implementation of copying javadoc for getters/setters, and fixed pretty printer to no longer inject an extra newline at the top of javadoc. --- .../resource/before/CommentsInterspersed.java | 8 +++-- .../resource/before/DelegateWithDeprecated.java | 4 ++- .../resource/before/GetterSetterJavadoc.java | 37 ++++++++++++++++++++++ .../resource/before/JavadocGenerally.java | 27 ++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 test/transform/resource/before/GetterSetterJavadoc.java create mode 100644 test/transform/resource/before/JavadocGenerally.java (limited to 'test/transform/resource/before') diff --git a/test/transform/resource/before/CommentsInterspersed.java b/test/transform/resource/before/CommentsInterspersed.java index e7898aaa..23a1060b 100644 --- a/test/transform/resource/before/CommentsInterspersed.java +++ b/test/transform/resource/before/CommentsInterspersed.java @@ -1,12 +1,16 @@ import /* cmt */ lombok./* cmt2 */Getter /* cmt3 */ ; public /*bla */ class CommentsInterspersed { - /** javadoc for field */ + /** + * javadoc for field + */ private int x; private /* bla2 */ @Getter String test = "foo"; //$NON-NLS-1$ - /** Javadoc on method */ + /** + * Javadoc on method + */ public native void gwtTest(); /*-{ javascript; }-*/ diff --git a/test/transform/resource/before/DelegateWithDeprecated.java b/test/transform/resource/before/DelegateWithDeprecated.java index b748c6ec..064e951d 100644 --- a/test/transform/resource/before/DelegateWithDeprecated.java +++ b/test/transform/resource/before/DelegateWithDeprecated.java @@ -6,7 +6,9 @@ class DelegateWithDeprecated { private interface Bar { @Deprecated void deprecatedAnnotation(); - /** @deprecated */ + /** + * @deprecated + */ void deprecatedComment(); void notDeprecated(); } diff --git a/test/transform/resource/before/GetterSetterJavadoc.java b/test/transform/resource/before/GetterSetterJavadoc.java new file mode 100644 index 00000000..e3ae0aac --- /dev/null +++ b/test/transform/resource/before/GetterSetterJavadoc.java @@ -0,0 +1,37 @@ +@lombok.Data +class GetterSetterJavadoc1 { + /** + * Some text + * + * @param fieldName Hello, World + * --- GETTER --- + * Getter section + * + * @return Sky is blue + */ + private int fieldName; +} + +class GetterSetterJavadoc2 { + /** + * Some text + * + * @param fieldName Hello, World + * @return Sky is blue + */ + @lombok.Getter @lombok.Setter private int fieldName; +} + +class GetterSetterJavadoc3 { + /** + * Some text + * + * **SETTER** + * Setter section + * @param fieldName Hello, World + * **GETTER** + * Getter section + * @return Sky is blue + */ + @lombok.Getter @lombok.Setter private int fieldName; +} diff --git a/test/transform/resource/before/JavadocGenerally.java b/test/transform/resource/before/JavadocGenerally.java new file mode 100644 index 00000000..ee015acf --- /dev/null +++ b/test/transform/resource/before/JavadocGenerally.java @@ -0,0 +1,27 @@ +/** + * Doc on package + */ +package testPackage; + +/** Weird doc */ +/** + * Doc on class + */ +class JavadocGenerally { + /** + * Doc on field + */ + private int someField; + + /** + * Doc on method + */ + public void test() { + } + + /** + * Doc on inner + */ + public interface TestingInner { + } +} -- cgit