[ 
https://issues.apache.org/jira/browse/CODEC-334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18065356#comment-18065356
 ] 

Gary D. Gregory commented on CODEC-334:
---------------------------------------

Hello [~shanjiang] 

Did you run this test? What were your results? The actual stack trace?

See the new tests in {{{}Base64OutputStreamTest{}}}; they pass on all Java LTS 
versions on GH.

Are you a real person or an AI bot?

 

> BaseNCodecOutputStream.close() throws on second call; violates Closeable 
> idempotency contract
> ---------------------------------------------------------------------------------------------
>
>                 Key: CODEC-334
>                 URL: https://issues.apache.org/jira/browse/CODEC-334
>             Project: Commons Codec
>          Issue Type: Bug
>            Reporter: Shan Jiang
>            Priority: Major
>
> ### Summary
> `BaseNCodecOutputStream.close()` is not idempotent: the second call attempts 
> to flush to an already-closed underlying stream, throwing `IOException`. The 
> `Closeable` contract (JDK 21 Javadoc) states: "If the stream is already 
> closed then invoking this method has no effect."
> ### How this was found
> Detected by automated JDK conformance oracle (`checkCloseIdempotent`).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to