Issue #20219: Fix AnnotationLocation false negative on JEP 512 compac…
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
Github, generate report for AnnotationLocation/all-examples-in-one
Report for AnnotationLocation/all-examples-in-one: https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/caa9bdbfe9f57ebe2760e69628db28afcdc78334_2026092942/reports/diff/index.html
Unrelated CI failure