[
https://issues.apache.org/jira/browse/COMPRESS-64?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12701408#action_12701408
]
Christian Grobmeier commented on COMPRESS-64:
---------------------------------------------
The behaviour should now be consistent.
- finish() doesn't call closeArchiveEntry() if necessary
- close() doesn't call finish() if necessary.
Everything is done in the subclasses. We may move the "is entry open" check to
the super classes as suggested. Additionally a check for "is finished" should
be done there. At the moment its easy to close an archive without calling
finish(), which leads to corrupt archives. An exception should be thrown like
in finish, if an entry is not closed.
> Are the public finish() methods ArchiveOutputStream implementations necessary
> and safe?
> ---------------------------------------------------------------------------------------
>
> Key: COMPRESS-64
> URL: https://issues.apache.org/jira/browse/COMPRESS-64
> Project: Commons Compress
> Issue Type: Bug
> Affects Versions: 1.0
> Reporter: Sebb
> Fix For: 1.0
>
>
> Some of the ArchiveOutputStream implementations have public finish() methods.
> These are currently only called from the close() methods.
> Seems to me that there is no need to allow the finish() methods to be called
> externally, and the user can corrupt the output if they do.
> Surely the close() method is all that is needed?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.