Use getCanonicalName() for array codegen in autofuzz reproducers#1043
Use getCanonicalName() for array codegen in autofuzz reproducers#1043
Conversation
1b9532f to
325db10
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #1026 where autofuzz generates invalid Java code for multi-dimensional arrays. The problem occurs because Class#getName() returns JVM type descriptors (e.g., [I for int[]) instead of valid Java source syntax. The fix changes the array codegen to use Class#getCanonicalName() which returns the proper Java source representation.
Changes:
- Updated array codegen in
Meta.javato usegetCanonicalName()instead ofgetName() - Added regression test target class with multi-dimensional array and inner class array parameters
- Added integration and unit tests to verify the fix
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/java/com/code_intelligence/jazzer/autofuzz/Meta.java | Changed array type codegen to use getCanonicalName() for proper Java source syntax |
| tests/src/test/java/com/example/AutofuzzMultiDimArrayTarget.java | Added regression test target with multi-dimensional arrays and inner class arrays |
| tests/BUILD.bazel | Added integration test for the multi-dimensional array fix |
| src/test/java/com/code_intelligence/jazzer/autofuzz/MetaTest.java | Added unit tests for multi-dimensional array and inner class array codegen |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/test/java/com/code_intelligence/jazzer/autofuzz/MetaTest.java
Outdated
Show resolved
Hide resolved
325db10 to
76fab08
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #1026