[jdk17u-dev] Integrated: 8287003: InputStreamReader::read() can return zero despite writing a char in the buffer

Todd V. Jonker duke at openjdk.org
Fri Aug 30 15:38:20 UTC 2024


On Thu, 18 Jul 2024 22:50:53 GMT, Todd V. Jonker <duke at openjdk.org> wrote:

> Backports a fix for a potential data-loss defect from JDK19 to JDK17.
> 
> This change is not clean, but the conflict is minimal and localized to `StreamDecoder.java`.
> 
> Viewing this diff alongside the original fix [here](https://github.com/openjdk/jdk/commit/6520843f86f638fe4d1e5b3358fab5799daca654?diff=unified&w=0#diff-e720d7662e29697b70409dd2aae7864f4e89d4bec33aa8d2ffce83cab365115eR184-R227) and expanding context upward a bit should be illuminating.  The conflict is due to structural/indentation difference when the lock acquisition at L158 was hoisted into a separate method.  That happened [here](https://github.com/openjdk/jdk/commit/9583e3657e43cc1c6f2101a64534564db2a9bd84?diff=unified&w=1#diff-e720d7662e29697b70409dd2aae7864f4e89d4bec33aa8d2ffce83cab365115eL154-L190) (wherein this file has an ugly diff obscuring relatively simple changes).
> 
> Additional testing:
> - [x] New regression test fails without the fix, passes with it
> - [x] linux-x86_64-server-release: `JTREG_KEYWORDS="!headful & !external-dep & !printer" make test` (tier1-3)

This pull request has now been integrated.

Changeset: 42b5e12b
Author:    Todd V. Jonker <jonker at amazon.com>
Committer: Paul Hohensee <phh at openjdk.org>
URL:       https://git.openjdk.org/jdk17u-dev/commit/42b5e12b58f6f6014ff841fe980fcf160c0330e0
Stats:     33 lines in 2 files changed: 24 ins; 1 del; 8 mod

8287003: InputStreamReader::read() can return zero despite writing a char in the buffer

Reviewed-by: phh
Backport-of: 6520843f86f638fe4d1e5b3358fab5799daca654

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

PR: https://git.openjdk.org/jdk17u-dev/pull/2726


More information about the jdk-updates-dev mailing list