fix(java): fix abstract enum and abstract array serialization for GraalVM #3095
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
Fix GitHub issue #2695: Abstract Class Corner Cases in Fory Serialization
Two problems were identified:
AbstractBase[]) would fail duringensureSerializersCompiled()because abstract types were incorrectly flagged as non-serializable.InsecureExceptionbecause the enum value classes (e.g.,AbstractEnum$1) were not recognized as secure.What does this PR do?
1. Fix
TypeResolver.isSerializable()2. Fix
ClassResolver.isSecure()3. Fix
ClassResolver.createSerializer()4. Fix
ClassResolver.ensureSerializersCompiled()5. Add comprehensive tests
ClassResolverTestfor abstract enum serialization and abstract object array serialization.AbstractClassExamplethat tests abstract enums, abstract enum arrays, abstract object arrays, and containers with abstract types.Related issues
Closes #2695
Does this PR introduce any user-facing change?
No user-facing API changes. Users can now serialize:
Enums with abstract methods (abstract enums)
Arrays with abstract component types containing concrete instances
Does this PR introduce any public API change?
Does this PR introduce any binary protocol compatibility change?
Benchmark
N/A - Bug fix only