Rename boxed array methods and add boxed array getters #9
+768
−88
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.
What problem(s) was I solving?
The existing API used method overloading to distinguish between primitive arrays (
byte[],int[], etc.) and their boxed counterparts (Byte[],Integer[], etc.). This approach had two issues:setByteArray(T, int, byte[])andsetByteArray(T, int, Byte[])can be confusing and error-prone, especially when working with generics or reflectionWhat user-facing changes did I ship?
Breaking change: Renamed all boxed array setter methods to use explicit "Boxed" naming:
setBooleanArray(T, int, Boolean[])→setBoxedBooleanArray(T, int, Boolean[])setByteArray(T, int, Byte[])→setBoxedByteArray(T, int, Byte[])setShortArray(T, int, Short[])→setBoxedShortArray(T, int, Short[])setIntArray(T, int, Integer[])→setBoxedIntArray(T, int, Integer[])setLongArray(T, int, Long[])→setBoxedLongArray(T, int, Long[])setFloatArray(T, int, Float[])→setBoxedFloatArray(T, int, Float[])setDoubleArray(T, int, Double[])→setBoxedDoubleArray(T, int, Double[])New feature: Added getter methods for all boxed array types:
getBoxedBooleanArray(T, int, int)getBoxedByteArray(T, int, int)getBoxedShortArray(T, int, int)getBoxedIntArray(T, int, int)getBoxedLongArray(T, int, int)getBoxedFloatArray(T, int, int)getBoxedDoubleArray(T, int, int)How I implemented it
ByteOpsinterface with renamed setter methods and new getter method signaturesAbstractByteOpsusing loops that call the corresponding single-value gettersAbstractByteOpsto match new method namesUnsignedByteOpsdelegate wrapper to use the new method namesHow to verify it
Manual Testing
mvn clean test- all tests passDescription for the changelog
Add explicit "Boxed" naming for boxed array operations and introduce getter methods for boxed arrays (
getBoxedBooleanArray,getBoxedByteArray, etc.). This is a breaking change that renames existing boxed array setters from overloaded names to explicitsetBoxed*Arraynames.