RFR: 4954405: Data buffers created with an offset are unusable [v2]
Alexey Ushakov
avu at openjdk.org
Mon Oct 27 11:33:42 UTC 2025
On Fri, 24 Oct 2025 21:01:35 GMT, Phil Race <prr at openjdk.org> wrote:
>> ByteInterleavedRaster is not including the DataBuffer offset in returns from getDataElements
>> The super-class sets it in the constructor which runs very much like this subclass except it omits this.
>> The parent class of ByteInterleavedRaster is ByteComponentRaster and it uses the DataBuffer offset
>> to adjust dataOffsets values used in all calculations.
>>
>> Instead ByteInterleavedRaster does something a bit different than other classes where it includes it in some instance vars
>> that also have additional offsets that apply for getPixels and getSamples but aren't used in getDataElements.
>>
>> It looks to me as if this is what ByteInterleavedRaster should also do instead.
>> All existing tests pass, and this resolves the specific complaint in the bug report.
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>
> 4954405
LGTM
-------------
Marked as reviewed by avu (Committer).
PR Review: https://git.openjdk.org/jdk/pull/27782#pullrequestreview-3383023972
More information about the client-libs-dev
mailing list