Skip to content

Java: Add support to Compact Source Files #20116

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

This PR adds support to compact source files (JEP 512).
I adds 2 new predicates Class.isImplicit and CompilationUnit.isCompactedSourceFile.

See internal PR for more info.

@IdrissRio IdrissRio added depends on internal PR This PR should only be merged in sync with an internal Semmle PR and removed documentation labels Jul 23, 2025
@IdrissRio IdrissRio force-pushed the idrissrio/compact-soruce-file branch from 05f6811 to 66b5755 Compare July 23, 2025 13:27
@IdrissRio IdrissRio force-pushed the idrissrio/compact-soruce-file branch 3 times, most recently from 6aac6ea to 246bbd4 Compare July 24, 2025 10:41
@IdrissRio IdrissRio force-pushed the idrissrio/compact-soruce-file branch 3 times, most recently from a5c64a6 to c9885d5 Compare July 28, 2025 14:50
@IdrissRio IdrissRio changed the base branch from main to idrissrio/java-dca-fix July 29, 2025 07:28
@IdrissRio IdrissRio force-pushed the idrissrio/java-dca-fix branch from 56cd9e7 to ac52a1b Compare July 29, 2025 07:45
Base automatically changed from idrissrio/java-dca-fix to main July 29, 2025 14:32
@IdrissRio IdrissRio force-pushed the idrissrio/compact-soruce-file branch from 41a7747 to 7e04c2b Compare July 29, 2025 14:51
@IdrissRio IdrissRio force-pushed the idrissrio/compact-soruce-file branch from 7e04c2b to 5a80595 Compare July 29, 2025 15:31
@IdrissRio IdrissRio marked this pull request as ready for review July 30, 2025 06:46
@Copilot Copilot AI review requested due to automatic review settings July 30, 2025 06:46
@IdrissRio IdrissRio requested a review from a team as a code owner July 30, 2025 06:46
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 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 isImplicitClass table
  • 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

}

class NotCompact {
//Test explict class
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

There is a spelling error in the comment: 'explict' should be 'explicit'.

Suggested change
//Test explict class
//Test explicit class

Copilot uses AI. Check for mistakes.

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