JDK-8260010 : UTF8ZipCoder not thread-safe since JDK-8243469
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 15,16,17
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2021-01-19
  • Updated: 2021-08-05
  • Resolved: 2021-01-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16 JDK 17
16.0.1Fixed 17 b07Fixed
Related Reports
Relates :  
Description
Vitaly Davidovich reports an IllegalStateException when inspecting a JarFile's contents using a parallel stream:

java.lang.IllegalStateException: Current state = CODING_END, new state = FLUSHED
               at
java.base/java.nio.charset.CharsetDecoder.throwIllegalStateException(CharsetDecoder.java:998)
               at
java.base/java.nio.charset.CharsetDecoder.flush(CharsetDecoder.java:681)
               at
java.base/java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:810)
               at
java.base/java.util.zip.ZipCoder.normalizedHashDecode(ZipCoder.java:136) 

This is due JDK-8243469 which changed the UTF-8 ZipCoder code to use a shared CharsetDecoder, which is not legal.
Comments
jdk15u Fix Request: This resolves a regression introduced in 15.0.0 where multi-threaded operations on zip/jar files can occasionally fail
22-01-2021

jdk16u Fix Request: This resolves a regression introduced in 15.0.0 where multi-threaded operations on zip/jar files can occasionally fail
22-01-2021

Changeset: 1f47de5f Author: Claes Redestad <redestad@openjdk.org> Date: 2021-01-20 23:42:29 +0000 URL: https://git.openjdk.java.net/jdk/commit/1f47de5f
20-01-2021