fix: fix incomplete behavior: Javadoc#setContent should parse tags#2765
Merged
pvojtechovsky merged 13 commits intoINRIA:masterfrom Nov 21, 2018
Merged
fix: fix incomplete behavior: Javadoc#setContent should parse tags#2765pvojtechovsky merged 13 commits intoINRIA:masterfrom
pvojtechovsky merged 13 commits intoINRIA:masterfrom
Conversation
d363509 to
fa8d5b6
Compare
Collaborator
Author
| String currentTagContent = ""; | ||
| CtJavaDocTag.TagType currentTag = null; | ||
|
|
||
| String[] lines = cleanComment(content).split("\n|\r\n|\r"); |
Collaborator
There was a problem hiding this comment.
cleanComment always returns string with CtComment.LINE_SEPARATOR as line separator.
So it is enough to write `split("\n")
| CtJavaDocTag docTag = this.getFactory().Code().createJavaDocTag(tagContent, tagType); | ||
| this.addTag(docTag); | ||
| } else if (!tagContent.isEmpty()) { | ||
| this.setContent(tagContent.trim()); |
Collaborator
There was a problem hiding this comment.
Is it recursive call to setContent which calls defineCommentContent, which calls setContent ... ?
I have not checked it deeper I just do not understand it on first sight.
Collaborator
|
Martin, it looks good to me. |
Collaborator
Author
|
ready to merge. |
Collaborator
|
Thank you Martin! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Javadoc#setContent should parse tags
for this, encapsulates tag parsing in CtJavaDocImpl
(baby PR to make progress on #2172)