feat(java): enhance java unsigned int/array type system#3190
Merged
chaokunyang merged 11 commits intoapache:mainfrom Jan 22, 2026
Merged
feat(java): enhance java unsigned int/array type system#3190chaokunyang merged 11 commits intoapache:mainfrom
chaokunyang merged 11 commits intoapache:mainfrom
Conversation
pandalee99
approved these changes
Jan 22, 2026
be85542 to
6e77799
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Java lacks native unsigned integer types and efficient primitive collections, forcing developers to:
This leads to reduced performance and increased memory overhead in scenarios involving unsigned data and large collections of primitives.
What does this PR do?
This PR enhances Fory's Java type system with comprehensive unsigned integer support and primitive-backed collections:
Unsigned Integer Types
Uint8,Uint16,Uint32,Uint64with proper unsigned arithmeticEXT_UINT8,EXT_UINT16,EXT_UINT32,EXT_VAR_UINT32,EXT_UINT64,EXT_VAR_UINT64)Primitive-Backed Collections
BoolList,Int8List,Int16List,Int32List,Int64List,Float32List,Float64ListUint8List,Uint16List,Uint32List,Uint64ListType System Enhancements
Types.UINT8throughTypes.UINT64)Types.BOOL_ARRAY,Types.INT8_ARRAY, etc.)FieldTypesto correctly handle unsigned type metadata during schema evolutionCode Generation Support
BaseObjectCodecBuilderto generate optimized serialization code for unsigned fieldsRelated issues
#1017
Does this PR introduce any user-facing change?
Yes - This PR introduces new public APIs:
New Types:
Uint8,Uint16,Uint32,Uint64wrapper classesNew Collections:
BoolList,Int8List,Int16List,Int32List,Int64List,Uint8List,Uint16List,Uint32List,Uint64List,Float32List,Float64ListNew Serializers:
UnsignedSerializersandPrimitiveListSerializersDoes this PR introduce any public API change?
Does this PR introduce any binary protocol compatibility change?
Benchmark
Performance benefits include:
Specific benchmarks can be added using the test classes:
PrimitiveListsTest- validates all primitive list operationsUnsignedTest- validates unsigned arithmetic and conversions