-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Issue #14446: Annotations inside javadoc inline tags should not be pa… #16462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* {@snippet : | ||
* import jakarta.persistence.Converter; | ||
* @Converter | ||
* public static class SomeSpecificClassConverter extends SomeBaseConverter { | ||
* // Some stuff here | ||
* } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lexer incorrectly classifies @converter
as a custom name Javadoc tag, while the parser expects to hit JAVADOC_INLINE_TAG_END
first, causing a mismatch.
The additional condition insideJavadocInlineTag == 0
ensures that the lexer does not consider @something
as a Javadoc tag when inside a Javadoc inline tag.
My workaround is to ensure annotations are not treated as Javadoc tags when inside a Javadoc inline tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any changes in performance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
2219dd8
to
ff136e8
Compare
… not be parsed as javadoc tag
ff136e8
to
16f5a89
Compare
@nrmancuso , please move details that you need, I am not sure what are they |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice hack 🎉
@mahfouz72 please generate a regression report with all javadoc checks (preferably on OpenJDK21+) |
Github, generate report |
All new violations are on javadoc that wasn't parsed before. Annotaions inside diff are on jdk21 only |
Removal of |
I am waiting on a follow up to #16462 (comment) . I don't see anything else needed here. |
Upon closer inspection, we have everything we need in #11455 |
|
||
@Test | ||
public void testAnnotationsInsideInlineTag() throws Exception { | ||
verifyJavadocTree(getDocPath("expectedAnnotationsInsideInlineTagAst.txt"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue was opened on AtclauseOrder to work.
I did not notice that it was proven to be working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue was opened for four different checks in the configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least we should share CLI on user config to see if output is reasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closes #14446
We should support
@snippet
ofc but this PR introduces a workaround to fix the bug.Diff Regression config: https://gist.githubusercontent.com/mohitsatr/f5a524a06294d907c84b9fc5b68661dc/raw/604872961df92db35e66c26218dc74c61bb10097/config.xml