[java] Deprecated CommentUtil, move implementation to AST Comment#1198
Conversation
|
That was a interesting rabbit whole 😄 So interesting is: FormalComment has basic support for javadoc tags: In Comment we parse the javadoc and add JavadocElement nodes as children... I moved the code into FormalComment. |
| * @return List of lines of the comments | ||
| */ | ||
| private List<String> multiLinesIn() { | ||
| String[] lines = getImage().split("\\R"); |
There was a problem hiding this comment.
support for the line break matcher is Java8+ only. We can however use the extended version of this:
\u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]
| boolean foundFirstNonEmptyLine = false; | ||
| for (String line : lines) { | ||
| if (StringUtils.isNoneBlank(line)) { | ||
| // new non-empty line: add all previous empty lines occurred before |
There was a problem hiding this comment.
isNoneBlank doesn't check the line is not empty, but actually if not a single character is a whitespace. So, "this is my comment" will fail this check for having 3 whitespaces. Is this really what you expect?
There was a problem hiding this comment.
I guess, I wanted to use isNotBlank - isNoneBlank is the same, but for multiple lines (it accepts a vararg ... String). So, the plural here would refer to multiple lines, not to multiple characters...
| private void findJavadocs(String commentText) { | ||
| Collection<JavadocElement> kids = new ArrayList<>(); | ||
|
|
||
| Map<String, Integer> tags = CommentUtil.javadocTagsIn(commentText); |
There was a problem hiding this comment.
shouldn't we avoid internal usage of CommentUtil as we are deprecating it?
Fixes #1174
Work in progress - this is missing: