fix(be:#2467): add GraalVM reflection metadata for zjsonpatch Jackson 3 - #2468
Conversation
- Add reflect-config.json for zjsonpatch Jackson 3 bridge classes and Jackson databind node types - Include META-INF resources in legacy pom.xml build resources configuration
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, targeted, and primarily add build/runtime metadata needed for native-image compatibility, with only minor optional config tightening suggested.
Pull request overview
Adds GraalVM native-image reflection metadata for the legacy module to support zjsonpatch’s Jackson 3 integration and ensures the native-image config is packaged as a resource during the Maven build.
Changes:
- Added
META-INF/native-image/reflect-config.jsonentries forcom.flipkart.zjsonpatch.mapping.jackson3.*and related Jackson node classes. - Updated
legacy/pom.xmlresources configuration to includeMETA-INF/**without filtering so GraalVM config files are copied into the build output.
File summaries
| File | Description |
|---|---|
| legacy/src/main/resources/META-INF/native-image/reflect-config.json | Adds reflection registration for zjsonpatch Jackson 3 wrappers and Jackson node types for native builds. |
| legacy/pom.xml | Ensures META-INF/native-image/** resources are included (unfiltered) in the legacy build output. |
Review details
Suppressed comments (3)
legacy/src/main/resources/META-INF/native-image/reflect-config.json:14
- Same redundancy here:
allPublicConstructors/allPublicMethodsadd no value whenallDeclaredConstructors/allDeclaredMethodsare enabled, and they broaden the reflection surface unnecessarily.
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
legacy/src/main/resources/META-INF/native-image/reflect-config.json:21
- Same redundancy here: consider removing the
allPublic*flags sinceallDeclared*already covers them.
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
legacy/src/main/resources/META-INF/native-image/reflect-config.json:28
- Same redundancy here:
allPublicConstructors/allPublicMethodsare unnecessary given theallDeclared*settings, and trimming them keeps the reflection config smaller and clearer.
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
- Add reflect-config.json for zjsonpatch Jackson 3 bridge classes and Jackson databind node types - Include META-INF resources in legacy pom.xml build resources configuration
58cf974 to
300b31d
Compare
…s://github.com/bcgov/nr-forest-client into fix/be/2467-egacy-zjsonpatch-native-reflection # Conflicts: # legacy/src/main/resources/META-INF/native-image/reflect-config.json
|
|
There was a problem hiding this comment.
🟡 Changes recommended
The added reflection config does not currently match the PR’s stated acceptance criteria for “full reflective access” on the zjsonpatch Jackson 3 bridge classes.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (3)
legacy/src/main/resources/META-INF/native-image/reflect-config.json:11
- PR description/acceptance criteria calls for full reflective access on zjsonpatch Jackson 3 bridge classes (declared + public constructors/methods), but this entry only enables the declared flags. Either update the metadata to include the public flags as well or adjust the PR description/AC to match what’s actually required.
{
"name": "com.flipkart.zjsonpatch.mapping.jackson3.Jackson3ArrayNodeWrapper",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
},
legacy/src/main/resources/META-INF/native-image/reflect-config.json:16
- PR description/acceptance criteria calls for full reflective access on zjsonpatch Jackson 3 bridge classes (declared + public constructors/methods), but this entry only enables the declared flags. Either update the metadata to include the public flags as well or adjust the PR description/AC to match what’s actually required.
{
"name": "com.flipkart.zjsonpatch.mapping.jackson3.Jackson3NodeWrapper",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
},
legacy/src/main/resources/META-INF/native-image/reflect-config.json:21
- PR description/acceptance criteria calls for full reflective access on zjsonpatch Jackson 3 bridge classes (declared + public constructors/methods), but this entry only enables the declared flags. Either update the metadata to include the public flags as well or adjust the PR description/AC to match what’s actually required.
{
"name": "com.flipkart.zjsonpatch.mapping.jackson3.Jackson3NodeFactory",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
},
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
|
|
Task Summary
Add GraalVM native-image reflection metadata for
zjsonpatch's Jackson 3 bridge classes, fixing status updates (e.g. changing a client's status to DECEASED) that fail when thelegacymodule runs as a native image. Fixes issue #2467.Background
Client status changes are applied as a JSON Patch via
zjsonpatch. Since the earlier Jackson 2 → Jackson 3 migration (PR #2446),zjsonpatchuses its Jackson 3 bridge classes (Jackson3ObjectNodeWrapper,Jackson3ArrayNodeWrapper,Jackson3NodeWrapper,Jackson3NodeFactory) and Jackson 3'sJsonNode/ObjectNode/ArrayNodetypes, all of which rely on reflection to construct and invoke methods at runtime. GraalVM native image strips unused reflective access by default unless it's explicitly declared, so without areflect-config.json, these classes fail to be constructed/invoked correctly in the compiled native image — surfacing to users as an inability to save a status change.Task Details
1.
legacy/src/main/resources/META-INF/native-image/reflect-config.jsonAdd a new GraalVM reflection configuration file registering full reflective access (
allDeclaredConstructors,allPublicConstructors,allDeclaredMethods,allPublicMethods) for the fourzjsonpatchJackson 3 bridge classes, plus declared constructor/method access for Jackson 3'stools.jackson.databind.JsonNode,ObjectNode, andArrayNode.2.
legacy/pom.xmlAdd a
<resource>entry to the build resources configuration to explicitly includeMETA-INF/**fromsrc/main/resources, ensuring the newreflect-config.json(and any otherMETA-INFnative-image metadata) is picked up and packaged during the build.3. Verification
legacymodule as a native image and confirmMETA-INF/native-image/reflect-config.jsonis present on the classpath/in the packaged artifact.Acceptance Criteria
reflect-config.jsonregisters the requiredzjsonpatchJackson 3 bridge classes and Jackson 3 node typeslegacy/pom.xmlcorrectly packagesMETA-INF/**resources into the build outputNotes
reflect-config.jsonnew,pom.xmlresource block addition).zjsonpatch's new Jackson 3 bridge classes.fix(be:#2467): add GraalVM reflection metadata for zjsonpatch Jackson 3, fixes issue [#2467](Unable to change status to DECEASED #2467).Thanks for the PR!
Deployments, as required, will be available below:
Any successful deployments (not always required) will be available here
Please create PRs in draft mode. Mark as ready to enable:
After merge, new images are deployed in: