[jdk17u-dev] RFR: 8292043: Incorrect decoding near EOF for stateful decoders like UTF-16

Roland Mesde duke at openjdk.org
Thu Nov 13 16:28:35 UTC 2025


Backporting JDK-8292043: Incorrect decoding near EOF for stateful decoders like UTF-16. Fixes incorrect state handling with EOF in StreamDecoder. There's a reset() call to the decoder seeing the EOF before the last decode() operation to handle the state correctly. Removing the call should not affect other cases because reset() is issued down the execution.

Also adds a new test. Ran GHA Sanity Checks (passed) and new test (passed). Patch is clean.

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

Commit messages:
 - Backport aa9b8f04bf74d5fa00f2b27895e7369abea3a930

Changes: https://git.openjdk.org/jdk17u-dev/pull/4177/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=4177&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8292043
  Stats: 80 lines in 2 files changed: 79 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk17u-dev/pull/4177.diff
  Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/4177/head:pull/4177

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


More information about the jdk-updates-dev mailing list