Repository navigation
SONARJAVA-7279 Resolve the JDK API of the target release through the new jdt-package option - #6459
leonardo-pilastri-sonarsource wants to merge 6 commits into
Conversation
…new jdt-package option
…ollectorsToListCheck The main sample runs at Java 16, where addFirst, addLast, removeFirst and removeLast no longer resolve, so it uses the older List methods instead. A dedicated sample checked at Java 21 keeps one compliant case for each of the four methods, and a noncompliant case as a control. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
⚖️ Ruling update ready for review: #6461 |
Guava is analyzed with sonar.java.source=17, so the API of Java 17 is now seen instead of the one of the JDK running the analysis: - ThreadDeath (deprecated for removal in 20) and Object.finalize() (in 18) are no longer reported by S5738, - the unsynchronized mark() and reset() overrides in HashingInputStream are now reported by S3551, as FilterInputStream declares them synchronized in 17. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The analysis now sees the API of the Java release it targets instead of the one of the JDK running it, so two sets of expected issues disappear: - eclipse-jetty S5738: Jetty targets Java 11, where SecurityManager and AccessController are not yet deprecated for removal (Java 17), - guava S2387: the shadowed fields (Reference.next, AbstractMap.keySet) are not public API, and are not part of the API of the release anymore. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…similar-to-main Same reason as for eclipse-jetty: Jetty targets Java 11, where SecurityManager is not deprecated for removal yet, so the issues of ContextHandler are gone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…sDebugEnabled Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Code Review ✅ Approved 2 closed / 2 findings🟡 Medium risk · Selecting release-specific JDK APIs changes Java symbol resolution; incorrect API selection could produce misleading findings across analyzed projects. Resolves the JDK API of the target release from the runtime image through the new jdt-package option, upgrading ✅ 2 closed✅ Quality: SequencedCollection mutators of CollectorsToListCheck lose all coverage
Closed: Cross-PR: Merging with #6451 silently drops the release-specific JDK API
Verification Rules 1/1 met PRs 4 inspectedFunctional validation No results Rules 1 passed 2 not applicable
Broader impact PRs 4 inspectedCross-PR 4 PRs 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 |
|




Summary by Gitar
SystemReleaseClasspathinJParserConfigjdt-packageto1.9.0.12280injava-frontend/pom.xmlRunFinalizersCheckTestexpectations for Java 10 API visibilityCollectorsToListCheckSequencedSamplecoveringSequencedCollectionmutators on Java 21S5738andS2387expectations and add aguavaS3551expectationThis will update automatically on new commits.