-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Java: Add support to ModuleImportDeclaration
#20097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ModuleImportDeclaration
16b0695
to
a16147c
Compare
a24e4ae
to
27cb373
Compare
} | ||
} | ||
|
||
// Diagnostic Matches: Unknown location for jdk.internal.RequiresIdentity+Annotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an internally generated annotation without a specific source location.
Excluding it from diagnostic will be addressed in a separate PR.
27cb373
to
e4848e0
Compare
There was a problem hiding this 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 support for Java 25 module import declarations, implementing the new import module
syntax feature. The implementation includes database schema updates, a new ModuleImportDeclaration
class, and comprehensive test coverage.
Key changes:
- Database schema updated to handle the new module import kind (value 6 in imports table)
- Added
ModuleImportDeclaration
class extendingImport
with methods to access module information and imported types/packages - Upgrade/downgrade scripts for database compatibility
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
java/ql/lib/semmle/code/java/Import.qll | Adds ModuleImportDeclaration class with methods to get module info and imported types/packages |
java/ql/lib/config/semmlecode.dbscheme | Updates imports table schema to include module import kind (6) with documentation |
java/ql/lib/upgrades/.../semmlecode.dbscheme | New schema version adding MODULEIMPORT kind to imports documentation |
java/ql/lib/upgrades/.../old.dbscheme | Previous schema version for upgrade compatibility |
java/ql/lib/upgrades/.../upgrade.properties | Upgrade script properties for module import declarations |
java/downgrades/.../semmlecode.dbscheme | Downgrade schema removing module import support |
java/downgrades/.../upgrade.properties | Downgrade script properties |
java/ql/test/library-tests/module-import-declarations/* | Test files validating module import functionality and expected outputs |
java/ql/lib/change-notes/2025-07-21-module-import-declarations.md | Release note documenting the new feature |
Support for Java 25 module import declarations:
ModuleImportDeclaration
class