Open carldenigma opened 1 month ago
https://checkstyle.org/releasenotes_old_8-0_8-34.html#Release_8.34
Update AbstractChecks to log DetailAST - MissingJavadocType. Author: HuGanghui #7747
Nuance is that
public class Example
is on line 6
`--CLASS_DEF -> CLASS_DEF [5:0]
beginning of class declaration is on line 5.
So this is visual problem, humans naturally expects violation to be on line where class
keyword is placed.
We started to report violations on AST nodes, to allow xpath suppression to work.
User will need to put javadoc comment above line 5 , not above line 6. Javadoc tool of jdk demands comments to be above annotations.
I see point of confusion, but in same time can not approve issue. Lets collect more opinions on this problem.
Thanks for the explanation
@carldenigma, consider closing issue if you agree with reasoning from me.
I have been working on upgrading an old Checkstyle configuration to the latest version. During this process, I noticed an issue related to missing Javadoc type for
CLASS_DEF
. The missing javadoc is now being incorrectly associated with a different line. After reviewing previous versions, I have identified that this change occurred in version 8.34.Simple Test Java File:
Test Checksum Config:
All versions show the correct tree in that the CLASS_DEF is on
[5:0]
Expected Result: MissingJavdocType will be reported for [5:] CLASS_DEF like it is in checksum 8.33
Output from 8.33 last known working version:
Actual Result: In all versions since 8.34 the ERROR line for MissingJavadocType gets reported as being on the annotation indent for Entity
[5:1]
instead of[5:]
8.34 output
latest 10.18.2 output