Integrated: 8283756: (zipfs) ZipFSOutputStreamTest.testOutputStream should only check inflated bytes

Volker Simonis simonis at openjdk.java.net
Mon Mar 28 13:44:43 UTC 2022


On Mon, 28 Mar 2022 08:04:59 GMT, Volker Simonis <simonis at openjdk.org> wrote:

> The test `ZipFSOutputStreamTest` deflates content into a zip file system and subsequently inflates the deflated files and checks their content against the original data.
> 
> The content consists of a data stream of bytes with the value `42`.
> 
> The check currently compares the temporary inflation buffer with the original source buffer, no matter how many bytes were inflated into the inflation buffer. This can lead to problems with alternative zlib implementations which sometimes write beyond the last inflated byte (see [JDK-8282648](https://bugs.openjdk.java.net/browse/JDK-8282648) for more details).
> 
> The fix is trivial. Only compare as many bytes as have been inflated against the original content.

This pull request has now been integrated.

Changeset: 0c472c8a
Author:    Volker Simonis <simonis at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/0c472c8a4ff01b3bc8fba5df82c24c240586e5c5
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8283756: (zipfs) ZipFSOutputStreamTest.testOutputStream should only check inflated bytes

Reviewed-by: jpai, alanb, lancea

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

PR: https://git.openjdk.java.net/jdk/pull/7984


More information about the nio-dev mailing list