Keep indentations in javadoc. Fixes #1571

This commit is contained in:
Roel Spilker
2018-02-07 00:19:24 +01:00
parent e6ecbe4f3a
commit 2f1069e48c
3 changed files with 7 additions and 1 deletions
@@ -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);
@@ -9,6 +9,9 @@ package testPackage;
class JavadocGenerally {
/**
* Doc on field
* <pre>
* // code
* </pre>
*/
private int someField;
/**
@@ -11,6 +11,9 @@ package testPackage;
class JavadocGenerally {
/**
* Doc on field
* <pre>
* // code
* </pre>
*/
private int someField;