From 2f1069e48c4641928ab3151a13a52b49062a29af Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Wed, 7 Feb 2018 00:18:20 +0100 Subject: Keep indentations in javadoc. Fixes #1571 --- src/delombok/lombok/delombok/DocCommentIntegrator.java | 2 +- test/transform/resource/after-delombok/JavadocGenerally.java | 3 +++ test/transform/resource/before/JavadocGenerally.java | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/delombok/lombok/delombok/DocCommentIntegrator.java b/src/delombok/lombok/delombok/DocCommentIntegrator.java index c3b07f32..2e96cb37 100644 --- a/src/delombok/lombok/delombok/DocCommentIntegrator.java +++ b/src/delombok/lombok/delombok/DocCommentIntegrator.java @@ -74,7 +74,7 @@ public class DocCommentIntegrator { return out; } - private static final Pattern CONTENT_STRIPPER = Pattern.compile("^(?:\\s*\\*)?[ \\t]*(.*?)$", Pattern.MULTILINE); + private static final Pattern CONTENT_STRIPPER = Pattern.compile("^(?:\\s*\\*)?(.*?)$", Pattern.MULTILINE); @SuppressWarnings("unchecked") private boolean attach(JCCompilationUnit top, final JCTree node, CommentInfo cmt) { String docCommentContent = cmt.content; if (docCommentContent.startsWith("/**")) docCommentContent = docCommentContent.substring(3); diff --git a/test/transform/resource/after-delombok/JavadocGenerally.java b/test/transform/resource/after-delombok/JavadocGenerally.java index 729cdce3..ec9483bc 100644 --- a/test/transform/resource/after-delombok/JavadocGenerally.java +++ b/test/transform/resource/after-delombok/JavadocGenerally.java @@ -9,6 +9,9 @@ package testPackage; class JavadocGenerally { /** * Doc on field + *
+	 * 	// code
+	 * 
*/ private int someField; /** diff --git a/test/transform/resource/before/JavadocGenerally.java b/test/transform/resource/before/JavadocGenerally.java index e47de44d..1df93385 100644 --- a/test/transform/resource/before/JavadocGenerally.java +++ b/test/transform/resource/before/JavadocGenerally.java @@ -11,6 +11,9 @@ package testPackage; class JavadocGenerally { /** * Doc on field + *
+	 * 	// code
+	 * 
*/ private int someField; -- cgit