aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2018-02-07 00:18:20 +0100
committerRoel Spilker <r.spilker@gmail.com>2018-02-07 00:19:24 +0100
commit2f1069e48c4641928ab3151a13a52b49062a29af (patch)
tree48a0d4303b8c7cb0ca6834be6b7699a850c107e9
parente6ecbe4f3ab2c16332c0209033dbb58aa2e28c2a (diff)
downloadlombok-2f1069e48c4641928ab3151a13a52b49062a29af.tar.gz
lombok-2f1069e48c4641928ab3151a13a52b49062a29af.tar.bz2
lombok-2f1069e48c4641928ab3151a13a52b49062a29af.zip
Keep indentations in javadoc. Fixes #1571
-rw-r--r--src/delombok/lombok/delombok/DocCommentIntegrator.java2
-rw-r--r--test/transform/resource/after-delombok/JavadocGenerally.java3
-rw-r--r--test/transform/resource/before/JavadocGenerally.java3
3 files changed, 7 insertions, 1 deletions
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
+ * <pre>
+ * // code
+ * </pre>
*/
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
+ * <pre>
+ * // code
+ * </pre>
*/
private int someField;