Java: Add support to Compact Source Files#20116
Merged
Conversation
05f6811 to
66b5755
Compare
6aac6ea to
246bbd4
Compare
java/downgrades/9f6026c400996c13842974b24f076a486ad1f69c/compilationUnit.ql
Fixed
Show fixed
Hide fixed
a5c64a6 to
c9885d5
Compare
56cd9e7 to
ac52a1b
Compare
7e04c2b to
5a80595
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Java 25 compact source files (JEP 512) by introducing two new predicates: Class.isImplicit() to identify implicitly declared classes and CompilationUnit.isCompactSourceFile() to identify compilation units containing compact source files.
- Added database schema support with new
isImplicitClasstable - Implemented library predicates for detecting compact source files and implicit classes
- Created comprehensive test suite with multiple query examples
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| java/ql/lib/config/semmlecode.dbscheme | Added isImplicitClass table definition for tracking implicit classes |
| java/ql/lib/semmle/code/java/Type.qll | Added Class.isImplicit() predicate to detect implicit classes |
| java/ql/lib/semmle/code/java/CompilationUnit.qll | Added CompilationUnit.isCompactSourceFile() predicate |
| java/ql/lib/upgrades/*/semmlecode.dbscheme | Database upgrade schema adding isImplicitClass table |
| java/ql/lib/upgrades/*/old.dbscheme | Previous database schema for comparison |
| java/downgrades/*/semmlecode.dbscheme | Database downgrade schema removing isImplicitClass table |
| java/downgrades/*/old.dbscheme | Previous schema for downgrade comparison |
| java/ql/test/library-tests/compact-source-files/* | Test files demonstrating compact source file functionality |
| java/ql/lib/change-notes/2025-07-23-compact-source-files.md | Release notes documenting the new feature |
5a80595 to
cd80877
Compare
jketema
reviewed
Aug 20, 2025
geoffw0
reviewed
Aug 20, 2025
10d4160 to
6633952
Compare
e0b9549 to
6247034
Compare
geoffw0
previously approved these changes
Aug 21, 2025
Contributor
geoffw0
left a comment
There was a problem hiding this comment.
LGTM (when the internal PR is approved as well).
564364b to
a34b362
Compare
6247034 to
cc48fdf
Compare
a34b362 to
5d2268f
Compare
cc48fdf to
fc1b927
Compare
esteffin
approved these changes
Sep 5, 2025
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 support to compact source files (JEP 512).
It adds 2 new predicates
Class.isImplicitandCompilationUnit.isCompactedSourceFile.See internal PR for more info.