Java: Add MaDs for java.lang.ScopedValue#20339
Merged
Conversation
Contributor
Click to show differences in coveragejavaGenerated file changes for java
- Java Standard Library,``java.*``,10,4621,260,99,,9,,,26
+ Java Standard Library,``java.*``,10,4628,260,99,,9,,,26
- Totals,,330,26328,2656,404,16,128,33,1,409
+ Totals,,330,26335,2656,404,16,128,33,1,409
- java.lang,38,3,783,,13,,,,,,1,,,,,,,,,,,,8,,,,11,,,4,,,1,,,,,,,,,,,,,,,,3,,,506,277
+ java.lang,38,3,790,,13,,,,,,1,,,,,,,,,,,,8,,,,11,,,4,,,1,,,,,,,,,,,,,,,,3,,,510,280 |
ef9b662 to
9bc14e0
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for modeling and testing dataflow through Java's new ScopedValue API, introduced in Java 25.
- Adds MaD (Models as Data) entries for ScopedValue operations to enable dataflow tracking
- Creates comprehensive test cases that verify taint propagation through scoped value bindings and retrievals
- Configures the test environment to use Java 25 with preview features enabled
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| java/ql/lib/ext/java.lang.scoped.model.yml | Defines dataflow models for ScopedValue API methods including value binding and retrieval |
| java/ql/test/library-tests/dataflow/scoped-values/test.ql | Test query that tracks taint flow from command line arguments to sink methods |
| java/ql/test/library-tests/dataflow/scoped-values/ScopedValueFlowTest.java | Java test code demonstrating various ScopedValue usage patterns for dataflow testing |
| java/ql/test/library-tests/dataflow/scoped-values/test.expected | Expected test results showing detected dataflow paths |
| java/ql/test/library-tests/dataflow/scoped-values/options | Compiler options to enable Java 25 preview features |
java/ql/test/library-tests/dataflow/scoped-values/ScopedValueFlowTest.java
Outdated
Show resolved
Hide resolved
4c987d7 to
2c076f6
Compare
java.lang.scopedjava.lang.ScopedValue
a34b362 to
5d2268f
Compare
aschackmull
reviewed
Sep 4, 2025
aschackmull
reviewed
Sep 4, 2025
java/ql/test-kotlin1/library-tests/java-kotlin-collection-type-generic-methods/test.expected
Outdated
Show resolved
Hide resolved
aschackmull
reviewed
Sep 4, 2025
java/ql/test/library-tests/dataflow/scoped-values/ScopedValueFlowTest.java
Outdated
Show resolved
Hide resolved
3320fa0 to
d0050b6
Compare
d0050b6 to
7ed16e0
Compare
7ed16e0 to
666678a
Compare
aschackmull
approved these changes
Sep 10, 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 pull request adds support for modeling and testing dataflow through Java's new
ScopedValueAPI, introduced in Java 25.Java Docs - Scoped Value: https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/ScopedValue.html
Java Docs - Carrier: https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/ScopedValue.Carrier.html
JEP: https://openjdk.org/jeps/506