checkstyle icon indicating copy to clipboard operation
checkstyle copied to clipboard

Issue #20219: Fix AnnotationLocation false negative on JEP 512 compac…

Open vivek-0509 opened this issue 5 months ago • 3 comments

Issue #20219:

AnnotationLocationCheck skipped annotations on top-level variables in compact source files. Its visitToken only treats a VARIABLE_DEF as a field when its parent is OBJBLOCK, but in a compact source file top-level fields are children of COMPACT_COMPILATION_UNIT, so they were ignored

Fix: treat COMPACT_COMPILATION_UNIT as a field container alongside OBJBLOCK, so top-level fields are validated like ordinary class fields while local/pattern variables stay out of scope

vivek-0509 avatar Jun 21 '26 08:06 vivek-0509

Github, generate report for AnnotationLocation/all-examples-in-one

vivek-0509 avatar Jun 21 '26 08:06 vivek-0509

Report for AnnotationLocation/all-examples-in-one: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/caa9bdbfe9f57ebe2760e69628db28afcdc78334_2026092942/reports/diff/index.html

github-actions[bot] avatar Jun 21 '26 09:06 github-actions[bot]

Unrelated CI failure

vivek-0509 avatar Jun 23 '26 16:06 vivek-0509