RFR: 8299748: java/util/zip/Deinflate.java failing on s390x [v6]

Volker Simonis simonis at openjdk.org
Fri Apr 28 08:48:53 UTC 2023


On Thu, 27 Apr 2023 17:05:24 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

>> DeInflate.java test fails on s390x platform because size for out1 array which is responsible for storing the compressed data is insufficient. And being unable to write whole compressed data on array, on s390 whole data can't be recovered after compression. This PR updates the check method in the DeInflate test to no longer rely on pre-defined lengths/sizes to determine whether deflate followed by an inflate of data worked correctly. These sizes can vary depending on the underlying zlib implementations. The updated check method now uses a `ByteArrayOutputStream` to deflate into and then inflate from. 
>> 
>> Thanks to @jaikiran for amazing PR description.
>
> Amit Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   changes request by @turbanoff

This change looks good except for the small improvement I suggested for `Arrays.equals(..)`.

Sorry for not having seen this earlier. I'm somehow proficient with issues due to different zlib implementations and could have probably helped to push this trough a litter quicker :)

I can sponsor your change once you've made the changes.

test/jdk/java/util/zip/DeInflate.java line 164:

> 162:             out2 = baos.toByteArray();
> 163:             if (n != len ||
> 164:                 !Arrays.equals(Arrays.copyOf(in, len), Arrays.copyOf(out2, len)) ||

Instead of copying the arrays you can use `Arrays.equals(in, 0, len, out2, 0 len)`

-------------

Changes requested by simonis (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/12283#pullrequestreview-1405477007
PR Review Comment: https://git.openjdk.org/jdk/pull/12283#discussion_r1180095155


More information about the core-libs-dev mailing list