Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

IdrissRio
Copy link
Contributor

@IdrissRio IdrissRio commented Jul 21, 2025

Support for Java 25 module import declarations:

  • Updated database schema to handle module import declarations
  • Added ModuleImportDeclaration class
  • Added tests to validate the new functionality
  • Added Upgrade/Downgrade scripts
  • Added Change Note

@IdrissRio IdrissRio changed the title Idrissrio/module import declarations Java: Add support to ModuleImportDeclaration Jul 21, 2025
@IdrissRio IdrissRio force-pushed the idrissrio/module-import-declarations branch 3 times, most recently from 16b0695 to a16147c Compare July 22, 2025 10:44
@IdrissRio IdrissRio added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Jul 22, 2025
@IdrissRio IdrissRio force-pushed the idrissrio/module-import-declarations branch 3 times, most recently from a24e4ae to 27cb373 Compare July 28, 2025 12:19
}
}

// Diagnostic Matches: Unknown location for jdk.internal.RequiresIdentity+Annotation
Copy link
Contributor Author

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.

@IdrissRio IdrissRio force-pushed the idrissrio/module-import-declarations branch from 27cb373 to e4848e0 Compare July 30, 2025 06:28
@IdrissRio IdrissRio marked this pull request as ready for review July 30, 2025 06:39
@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 06:39
@IdrissRio IdrissRio requested a review from a team as a code owner July 30, 2025 06:39
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 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 extending Import 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
depends on internal PR This PR should only be merged in sync with an internal Semmle PR documentation Java
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy