Skip to content

refactor(java): unify serializer write/read APIs and remove xwrite/xread#3400

Merged
chaokunyang merged 11 commits intoapache:mainfrom
chaokunyang:unify_java_native_xlang_api
Feb 24, 2026
Merged

refactor(java): unify serializer write/read APIs and remove xwrite/xread#3400
chaokunyang merged 11 commits intoapache:mainfrom
chaokunyang:unify_java_native_xlang_api

Conversation

@chaokunyang
Copy link
Collaborator

@chaokunyang chaokunyang commented Feb 24, 2026

Why?

  • The Java serializer stack had two parallel APIs (write/read and xwrite/xread) with duplicated logic and branching.
  • That duplication increased maintenance cost and made behavior alignment between native Java and xlang paths harder.

What does this PR do?

  • Unifies serializer APIs around write/read and removes xwrite/xread call paths across Fory and serializers.
  • Refactors Fory read/write flows to dispatch by mode internally (Java vs cross-language) while keeping shared fast paths for primitive types.
  • Removes legacy SerializationBinding indirection in serializer and serializer/collection packages and switches call sites to direct serializer/ref-mode APIs.
  • Consolidates string serialization method usage (writeString/readString) and updates MemoryBufferObjectInput/Output and serializer call sites.
  • Updates GraalVM native-image metadata to drop deleted binding classes and updates affected Java/xlang tests accordingly.

Related issues

Closes #3399
#1017

Does this PR introduce any user-facing change?

  • Yes. Custom serializers should use write/read; xwrite/xread-based implementations are removed.
  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

N/A (refactor-focused PR).

@chaokunyang chaokunyang mentioned this pull request Feb 24, 2026
16 tasks
@chaokunyang chaokunyang merged commit 4febc66 into apache:main Feb 24, 2026
58 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.

[Java] unify serializer write/read APIs and remove xwrite/xread

2 participants