Skip to content

Conversation

kaspersv
Copy link
Contributor

@kaspersv kaspersv commented Aug 27, 2025

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.

@kaspersv kaspersv requested a review from a team as a code owner August 27, 2025 10:01
@Copilot Copilot AI review requested due to automatic review settings August 27, 2025 10:01
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions github-actions bot added the Java label Aug 27, 2025
@kaspersv kaspersv force-pushed the kaspersv/discard-fields-and-classes branch from 23b5c5d to 9cc6e9c Compare August 27, 2025 10:08
@kaspersv kaspersv added the no-change-note-required This PR does not need a change note label Aug 27, 2025
@kaspersv kaspersv requested a review from aschackmull August 28, 2025 09:19
@kaspersv
Copy link
Contributor Author

kaspersv commented Sep 1, 2025

@aschackmull Could you take a look at this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant