feat: ValuePool can now reference suppliers in any class#1046
Open
feat: ValuePool can now reference suppliers in any class#1046
Conversation
3a489f3 to
e9fcaad
Compare
There was a problem hiding this comment.
Pull request overview
This pull request enhances the @ValuePool annotation to support supplier methods from any class, not just the fuzz test class. Previously, users could only reference supplier methods by their simple name within the same test class. Now, they can use fully qualified references with the format com.example.ClassName#methodName or com.example.OuterClass$InnerClass#methodName for nested classes.
Changes:
- Added support for fully qualified supplier method references in the format
ClassName#methodName - Refactored
ValuePoolRegistryto resolve and load supplier methods from any class with fallback class loader strategy - Added comprehensive test coverage for external supplier references, nested classes, validation, and edge cases
- Updated documentation in both Javadoc and markdown files with examples and usage guidelines
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/code_intelligence/jazzer/mutation/support/ValuePoolRegistry.java | Refactored supplier resolution to support fully qualified method references with dynamic class loading and validation |
| src/main/java/com/code_intelligence/jazzer/mutation/annotation/ValuePool.java | Updated Javadoc to document the new fully qualified reference syntax |
| src/test/java/com/code_intelligence/jazzer/mutation/support/ValuePoolRegistry.java | Added new test support class with external supplier methods for testing cross-class references |
| src/test/java/com/code_intelligence/jazzer/mutation/support/ValuePoolsTest.java | Added 15 new test cases covering external suppliers, nested classes, validation, caching, and error scenarios |
| src/test/java/com/code_intelligence/jazzer/mutation/support/BUILD.bazel | Added the new test support file to the build configuration |
| docs/mutation-framework.md | Updated documentation with examples of fully qualified supplier references and improved clarity on type propagation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/main/java/com/code_intelligence/jazzer/mutation/support/ValuePoolRegistry.java
Show resolved
Hide resolved
src/main/java/com/code_intelligence/jazzer/mutation/support/ValuePoolRegistry.java
Outdated
Show resolved
Hide resolved
e9fcaad to
f9e87fc
Compare
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.
When specifying supplier methods for
@ValuePoolannotation, it is now possible to use fully qualified names to access methods of any class, not just the fuzz test class. E.g.: