This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git
The following commit(s) were added to refs/heads/main by this push:
new 648c5733e chore: update java checks docs (#3707)
648c5733e is described below
commit 648c5733e31ed50f4c358b710e95074225766d12
Author: Shawn Yang <[email protected]>
AuthorDate: Wed May 27 08:33:19 2026 +0800
chore: update java checks docs (#3707)
<!--
**Thanks for contributing to Apache Fory™.**
**If this is your first time opening a PR on fory, you can refer to
[CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).**
Contribution Checklist
- The **Apache Fory™** community has requirements on the naming of pr
titles. You can also find instructions in
[CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).
- Apache Fory™ has a strong focus on performance. If the PR you submit
will have an impact on performance, please benchmark it first and
provide the benchmark result here.
-->
## Why?
<!-- Describe the purpose of this PR. -->
## What does this PR do?
<!-- Describe the details of this PR. -->
## Related issues
<!--
Is there any related issue? If this PR closes them you say say
fix/closes:
- #xxxx0
- #xxxx1
- Fixes #xxxx2
-->
## AI Contribution Checklist
<!-- Full requirements and disclosure template:
https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs
-->
- [ ] Substantial AI assistance was used in this PR: `yes` / `no`
- [ ] If `yes`, I included a completed [AI Contribution
Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs)
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.
<!-- If substantial AI assistance = `yes`, paste the completed checklist
and disclosure block here, including the final ai_review summary and
screenshot evidence 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?
<!--
If any user-facing interface changes, please [open an
issue](https://github.com/apache/fory/issues/new/choose) describing the
need to do so and update the document if necessary.
Delete section if not applicable.
-->
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark
<!--
When the PR has an impact on performance (if you don't know whether the
PR will have an impact on performance, you can submit the PR first, and
if it will have impact on performance, the code reviewer will explain
it), be sure to attach a benchmark data here.
Delete section if not applicable.
-->
---
docs/specification/java_serialization_spec.md | 12 ++++++++----
.../org/apache/fory/serializer/ObjectStreamSerializer.java | 3 +++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/docs/specification/java_serialization_spec.md
b/docs/specification/java_serialization_spec.md
index d0a7e18a0..6ca5f9a7d 100644
--- a/docs/specification/java_serialization_spec.md
+++ b/docs/specification/java_serialization_spec.md
@@ -576,11 +576,15 @@ without a `chunk_size` byte:
- non-null key and null value: special null-value header, then key payload.
- null key and null value: `KV_NULL` header only.
-`EnumMap` writes one serializer-owned payload mode byte before its normal map
-payload:
+`EnumMap` writes its entry count, key enum class metadata, and then its normal
+map entry payload:
+
+```text
+| varuint32_small7 size | key enum class metadata | chunk... |
+```
-- `0`: normal payload follows.
-- `1`: Java-serialized empty `EnumMap` payload.
+The key enum class metadata is present even when `size` is zero so an empty
+`EnumMap` can be reconstructed with the original key type.
### Map Subclasses
diff --git
a/java/fory-core/src/main/java/org/apache/fory/serializer/ObjectStreamSerializer.java
b/java/fory-core/src/main/java/org/apache/fory/serializer/ObjectStreamSerializer.java
index 2e7a8df80..4c548a260 100644
---
a/java/fory-core/src/main/java/org/apache/fory/serializer/ObjectStreamSerializer.java
+++
b/java/fory-core/src/main/java/org/apache/fory/serializer/ObjectStreamSerializer.java
@@ -291,6 +291,9 @@ public class ObjectStreamSerializer extends
AbstractObjectSerializer {
ClassResolver classResolver = (ClassResolver) typeResolver;
TreeMap<Integer, ObjectInputValidation> callbacks = new
TreeMap<>(Collections.reverseOrder());
for (int i = 0; i < numClasses; i++) {
+ // Matching layers are admitted by the registered root object type;
requiring each
+ // serializable superclass to be registered would make normal
ObjectStream hierarchy reads
+ // unusable. Sender-only layers are checked below before their data is
skipped.
Class<?> currentClass =
classResolver.readClassInternalUnchecked(readContext);
// Find the matching local slot for sender's class
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]