chaokunyang opened a new pull request, #3846:
URL: https://github.com/apache/fory/pull/3846
## Why?
Fory JSON generates codecs from each `ForyJsonBuilder` configuration. Those
configurations affect
field discovery, naming, null handling, custom codecs, and generated source,
so one codec generated
during Native Image construction cannot represent every runtime builder.
Native executables also
cannot run the existing runtime compiler.
This change supports the complete interpreted JSON codec path in GraalVM
Native Image while keeping
ordinary JVM code generation enabled and unchanged.
## What does this PR do?
- adds the non-inherited `@JsonType` marker for reachable native JSON object
models;
- adds an automatically activated MR-JAR Native Image Feature that registers
the reflection,
constructor, unsafe-field, record, container, built-in, and
annotation-codec metadata used by the
interpreted path;
- supports declaration, inherited, nested type-use, record, accessor, and
creator `@JsonCodec`
locations without constructing codecs at image build time;
- disables JSON runtime code generation and asynchronous compilation only
inside native images;
- preserves every other `ForyJsonBuilder` option for independently
configured runtime instances;
- adds classpath and JPMS GraalVM acceptance coverage, MR-JAR/source-JAR
verification, and user
documentation.
The hosted scanner reuses the existing Fory core metadata owner and the
effective JSON-member
classification owned by `ObjectCodecBuilder`. Hosted work does not enter
serialization or
deserialization hot paths, and the ordinary-JDK builder loop remains
unchanged.
## Related issues
None.
## AI Contribution Checklist
- [x] Substantial AI assistance was used in this PR: `yes`
- [x] The standardized `AI Usage Disclosure` is included below.
- [ ] The human contributor can explain and defend all important changes
without AI help.
- [ ] The human contributor reviewed all AI-assisted code changes line by
line.
- [x] Line-by-line agent self-review and two complete review/fix rounds were
performed before the
final policy reviews.
- [x] Two fresh reviewers inspected final HEAD
`ff78082e552eaa2aafafd3c6ea296eb83ad9c47d`:
one Fory-guided reviewer and one independent general reviewer.
- [x] All actionable review comments were fixed and both final reviewers
reported clean results.
- [x] Persisted final review evidence is linked below.
- [x] Relevant tests, native-image matrices, packaging checks, formatting,
and documentation checks
were run successfully.
- [ ] The human contributor confirmed provenance and licensing before
marking this PR ready.
### AI Usage Disclosure
- `substantial_ai_assistance`: yes
- `scope`: design drafting, implementation, refactor suggestions, tests,
documentation, review, and
CI preparation
- `affected_files_or_subsystems`: `java/fory-json`, Fory core Native Image
record metadata,
`integration_tests/graalvm_tests`, and Java user documentation
- `ai_review`: line-by-line agent self-review completed; two review/fix
rounds completed; final
fresh Fory-guided and independent general reviewers found no actionable
issues on HEAD
`ff78082e552eaa2aafafd3c6ea296eb83ad9c47d`
- `ai_review_artifacts`: [Fory-guided final review](GUIDED_REVIEW_URL) and
[independent general final review](INDEPENDENT_REVIEW_URL)
- `human_verification`: automated local verification was executed and the
results were reviewed in
the development workspace; personal contributor attestation remains
intentionally unchecked
while this PR is a draft
- `performance_verification`: hosted discovery is outside runtime hot paths;
the ordinary-JDK
`ObjectCodecBuilder` loop remains unchanged; no per-value or per-field
runtime allocation was
added
- `provenance_license_confirmation`: no third-party implementation was
copied or added; final human
provenance confirmation remains pending before ready-for-review
## Does this PR introduce any user-facing change?
- [x] Does this PR introduce any public API change? Adds `@JsonType`.
- [ ] Does this PR introduce any binary protocol compatibility change?
## Validation
- `cd java && ENABLE_FORY_DEBUG_OUTPUT=1 mvn -T8 -pl fory-core,fory-json -am
test`
- Fory core: 2,184 tests, 0 failures
- Fory JSON: 593 tests, 0 failures
- GraalVM 21 classpath native package/run: passed, `Fory JSON succeed`
- GraalVM 21 JPMS native package/run: passed, `Fory JSON succeed`
- GraalVM 25 classpath native package/run: passed, `Fory JSON succeed`
- GraalVM 25 JPMS native package/run: passed, `Fory JSON succeed`
- Fory JSON MR-JAR and source-JAR verification: passed
- Java and integration Spotless checks: passed
- Markdown Prettier and `git diff --check`: passed
## Benchmark
Not applicable. The change adds Native Image hosted metadata discovery and
native-only builder
resolution. It does not change ordinary JVM serialization/deserialization
hot paths, and no new
runtime allocation is introduced there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]