jdk17u-dev icon indicating copy to clipboard operation
jdk17u-dev copied to clipboard

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

Open toddjonker opened this issue 7 months ago • 5 comments

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 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 (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)

Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [ ] JDK-8287003 needs maintainer approval
  • [x] Commit message must refer to an issue

Error

 ⚠️ OCA signatory status must be verified

Issue

  • JDK-8287003: InputStreamReader::read() can return zero despite writing a char in the buffer (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk17u-dev.git pull/2726/head:pull/2726
$ git checkout pull/2726

Update a local copy of the PR:
$ git checkout pull/2726
$ git pull https://git.openjdk.org/jdk17u-dev.git pull/2726/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2726

View PR using the GUI difftool:
$ git pr show -t 2726

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk17u-dev/pull/2726.diff

toddjonker avatar Jul 18 '24 22:07 toddjonker