Repository: commons-compress Updated Branches: refs/heads/master 18daf66b2 -> 952a50372
COMPRESS-357 better synchronize finished method Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/952a5037 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/952a5037 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/952a5037 Branch: refs/heads/master Commit: 952a50372dea32e78800b5127ce3e969ce8ba5f0 Parents: 18daf66 Author: Stefan Bodewig <bode...@apache.org> Authored: Thu May 26 17:02:01 2016 +0200 Committer: Stefan Bodewig <bode...@apache.org> Committed: Thu May 26 17:02:01 2016 +0200 ---------------------------------------------------------------------- src/changes/changes.xml | 4 ++++ .../compress/compressors/bzip2/BZip2CompressorOutputStream.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/952a5037/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index e5517b3..5af4506 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -70,6 +70,10 @@ The <action> type attribute can be add,update,fix,remove. TarArchiveInputStream failed to parse PAX headers whose tar entry name ended with a slash. </action> + <action issue="COMPRESS-357" type="fix" date="2016-05-26"> + BZip2CompressorOutputStream#finished is now synchronized to + avoid a race condition with the finalize method. + </action> </release> <release version="1.11" date="2016-04-06" description="Release 1.11"> http://git-wip-us.apache.org/repos/asf/commons-compress/blob/952a5037/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java index 9de51d4..3bdee5a 100644 --- a/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java +++ b/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java @@ -476,7 +476,7 @@ public class BZip2CompressorOutputStream extends CompressorOutputStream } - public void finish() throws IOException { + public synchronized void finish() throws IOException { if (out != null) { try { if (this.runLength > 0) {