Repository navigation
SONARJAVA-6048 Recognize qualified Deprecated annotations - #6499
romainbrenguier wants to merge 2 commits into
Conversation
Co-Authored-By: Fabrik <fabrik@sonar.ai>
Preserve short-name detection and resolve qualified annotation types against java.lang.Deprecated. Keep missing-tag reports for qualified annotations. Co-Authored-By: Fabrik <fabrik@sonar.ai>
Code Review ✅ Approved🟡 Medium risk · The shared helper now recognizes resolved java.lang.Deprecated annotations, changing S1123/S1133 findings and potentially suppressing or adding incorrect deprecation reports. Recognizes qualified Verification Rules 2/2 met Repos 3 inspected · PRs 1 inspectedFunctional validation No results Rules 2 passed 1 not applicable
Broader impact Repos 3 inspected PRs 1 inspectedCross-repo 3 repositories inspected 0 open impacts
Cross-PR 1 PR inspected 0 open impacts
Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
CI has resolved the plugin-packaging validation gap for head The local heap-exhaustion result remains recorded. Windows unit tests, ruling QA, plugin QA, and analysis are still running. This PR will remain in draft for the requester. Generated by Fabrik |
|
|
The secret scanner flagged potential token data in two CI ruling logs. I excluded the flagged lines from review and did not read their values. These findings are in CI output, not in source lines changed by this PR. REPORT-ONLY: Linux SonarQube ruling log, lines 2891 and 3000, The reviewed unflagged output shows successful ruling tests. No source change was made for these log findings. Generated by Fabrik |
|
Gates passed, draft kept at requester request: #6499. Passed: validated head, required CI checks, Sonar quality gate, resolved review threads and required automated reviews. Mark it ready when your review is complete. Generated by Fabrik |




SONARJAVA-6048 — https://sonarsource.atlassian.net/browse/SONARJAVA-6048
Human description
S1123 now recognizes
@java.lang.Deprecatedwhen the declaration also has an@deprecatedJavadoc tag. This removes incorrect missing-annotation reports, including those on protobuf-style enum methods.Declarations that lack the Javadoc tag still produce the valid missing-tag report. Short-form annotation detection stays unchanged.
Agent description
Approach and acceptance coverage
Keep the identifier branch and check the resolved type for qualified annotations. Store
java.lang.Deprecatedin a class constant as requested in the ticket. Return the original annotation so its attributes remain available to shared-helper consumers.Regression cases cover methods, enum methods, classes, fields, missing tags, unrelated qualified annotations, and annotation attributes. Existing tests exercise S1123 and S1133 with and without semantics. The shared helper also restores S1133 recognition of qualified annotations.
The direct Jira invocation and explicit operator handover authorize this scope. The existing regression and implementation commits were retained. Specification SHA-256:
4568a43f5f2aab7807a8a486da075b59e6886eb8c63f7d4e319f3d62f5c4a1a0. Decision record: none changed. No metadata or profile changes are needed for this existing-rule correction.Validation and gates
The full test summaries report 5,082 tests with zero failures and errors, and four skipped. The original 31 focused regressions also passed. The full Maven install attempt failed during plugin packaging with heap exhaustion. Resuming packaging with a 2 GiB heap on both declared Java 26 and Java 21 also failed; no successful full install is claimed.
Independent review: clean, round 2, gpt-6.1-sol, zero blocking findings. The interrupted first attempt is retained and is not counted as a successful review.
Vortex supplied 10 project guidelines and 20 Java guidelines. These guided the small helper change and parameterized regression tests. Context and agentic analysis are enabled for the bound project. Final DEEP analysis found no issues across all four changed files. Changed-file secrets scanning and diff whitespace checks passed.
Local validation: unit tests passed; plugin packaging incomplete. Independent review: passed. Vortex: passed. CI, repository Sonar gate, automated reviewers, and review threads: pending live PR checks. Human approval: pending. Keep-draft: required by the requester in the operator handover; the requester will mark this PR ready.
Warnings and validation gaps
.sonar-code-context/SONAR.mdfile is absent. Live project guidelines were retrieved. Reviewers can supply missing guidance if it affects this correction.Attachments used
history.json: reference for prior decisions.proposed-approach-20260405-114737.md: requirement for the bounded correction.simple-examples.json: reference for regression examples.proposed-code.diff: reference for the proposed helper change.actual-fix-coverage.json: reference; impact claims remain unverified.Token usage: gpt-6.1-sol — 15,490,316 tokens, including 723,114 tokens attributed to the completed independent-review session. Accounting is measured, not a price estimate.
This PR was opened as a draft by the autonomous Fabrik workflow. It will remain in draft for the requester, including after its mechanical gates pass. Human approval and merge are required. No merge or deployment is authorized.
🤖 Co-authored by Fabrik