Skip to content

Commit 703f4fa

Browse files
committed
Fix stream being close twice
The close method should be idemptotent, however, the JDK8 FilterOutputStream#close() method is not...
1 parent 1ef3fc4 commit 703f4fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/codehaus/plexus/archiver/zip/AbstractZipArchiver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,10 @@ protected void close() throws IOException {
651651
if (zipArchiveOutputStream != null) {
652652
if (zOut != null) {
653653
zOut.writeTo(zipArchiveOutputStream);
654+
} else {
655+
zipArchiveOutputStream.close();
654656
}
655-
zipArchiveOutputStream.close();
657+
zipArchiveOutputStream = null;
656658
}
657659
} catch (IOException ex) {
658660
// If we're in this finally clause because of an

0 commit comments

Comments
 (0)