Overlay: Add discarding for Java classes, interfaces & fields#20294
Merged
Overlay: Add discarding for Java classes, interfaces & fields#20294
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds discarding capabilities for Java classes, interfaces, and fields in the CodeQL library by introducing overlay classes that extend DiscardableReferableLocatable.
- Adds overlay import to Type.qll for discarding functionality
- Creates discardable overlay classes for ClassOrInterface and Field types
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| java/ql/lib/semmle/code/java/Type.qll | Adds overlay import and DiscardableClassOrInterface class |
| java/ql/lib/semmle/code/java/Member.qll | Adds DiscardableField overlay class |
23b5c5d to
9cc6e9c
Compare
Contributor
Author
|
@aschackmull Could you take a look at this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds discarding for Java classes, interfaces & fields. For all three entities, entity ids are generated using TRAP keys and the entities are therefore only discarded from base if their file is extracted in the overlay variant and the entity is not extracted in the overlay.
DCA experiments show no effect on overlay analysis accuracy on the code-scanning query suite (main vs. with additional discarding) and a tiny improvement on the full nightly query suite (main vs. with additional discarding).
For https://github.com/github/codeql-core/issues/5024.