On 2016-06-10, Torsten Curdt wrote:

>> You'll see that findbugs is unhappy about inconsistent synchronization
>> introduced when I made the finish method of BZip2CompressorOutputStream
>> synchronized due to COMPRESS-357

> My feedback: I'd rather recommend to get rid of the finalize over adding
> synchronization. Using finalize is rarely a good idea. I wasn't aware we
> have that in the code base.

We have it in two cases, ZipFile and BZip2CompressorOutputStream -
ZipFile uses a volatile flag rather than synchronization and
null-assignment, maybe that's the better option anyway.

Even if we agree that having finalize in BZip2CompressorOutputStream we
can't easily change the behavior without breaking code that relies on
not being forced to finish the stream.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to