Skip to content

feat(java): support nested type-use serialization metadata#3633

Merged
chaokunyang merged 10 commits into
apache:mainfrom
chaokunyang:nested_container_override_support_for_java
Apr 29, 2026
Merged

feat(java): support nested type-use serialization metadata#3633
chaokunyang merged 10 commits into
apache:mainfrom
chaokunyang:nested_container_override_support_for_java

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented Apr 29, 2026

Why?

Java could not consistently carry integer encoding and unsigned type metadata through nested generic type-use positions, so maps, lists, sets, primitive-list carriers, and compatible-mode skip paths could lose the remote field metadata needed for correct xlang serialization. The Java unsigned APIs also used inconsistent Uint* naming and carrier types that did not match the unsigned ranges exposed to other languages.

What does this PR do?

  • Adds Java TYPE_USE support for integer metadata annotations and preserves nested TypeExtMeta through TypeRef, GenericType, type definitions, field metadata, resolvers, serializers, compatible skip logic, and generated object codecs.
  • Renames and normalizes Java unsigned APIs around UInt* annotations/list carriers, UInt*Elements array metadata, Int32Encoding/Int64Encoding, and int/long carriers that can represent the unsigned ranges.
  • Updates Java IDL/codegen to emit @ForyStruct and nested integer annotations for generated generic containers, including corrected unsigned scalar carrier mappings.
  • Extends Java, Rust, and Swift xlang/integration coverage for nested annotated containers, compatible/schema-consistent round trips, compatible missing/different field metadata, unsigned carrier validation, primitive arrays/lists, and generated Java output.
  • Refreshes docs, README examples, and xlang specs for withXlang/withCompatible, @ForyStruct, renamed integer annotations, nested generic annotation usage, and unsigned carrier rules; adds C++ IDL CMake build caching in CI.

Related issues

#1017
#3630
#3625

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist in this PR description and the required AI Usage Disclosure.
  • If yes, my PR description includes the required ai_review summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

@chaokunyang chaokunyang merged commit 621e449 into apache:main Apr 29, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants