You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2026/03/06 02:25:00 UTC

[jira] [Commented] (COMMONSSITE-186) apache/commons-codec — BaseNCodecOutputStream.close() not idempotent

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

Gary D. Gregory commented on COMMONSSITE-186:
---------------------------------------------

Wrong project.

> apache/commons-codec — BaseNCodecOutputStream.close() not idempotent
> --------------------------------------------------------------------
>
>                 Key: COMMONSSITE-186
>                 URL: https://issues.apache.org/jira/browse/COMMONSSITE-186
>             Project: Apache Commons All
>          Issue Type: Bug
>            Reporter: Shan Jiang
>            Priority: Major
>
> `BaseNCodecOutputStream.close()` throws on second call — violates Closeable idempotency contract
>  
> ### 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)