RFR [14] JDK-8225763 Inflater and Deflater should implement AutoCloseable
David Lloyd
david.lloyd at redhat.com
Tue Jul 9 15:14:18 UTC 2019
On Tue, Jul 9, 2019 at 8:19 AM Jaikiran Pai <jai.forums2013 at gmail.com> wrote:
> - In addition, I have sneaked in an unrelated change in this patch, into
> the Deflater.end() method:
>
> public void end() {
> synchronized (zsRef) {
> + // check if already closed
> + if (zsRef.address() == 0) {
> + return;
> + }
> zsRef.clean();
> input = ZipUtils.defaultBuf;
> + inputArray = null;
> + }
>
> Unlike in the Inflater.end(), the Deflater.end() didn't previously have
> the "inputArray = null". I have included it in this patch, since it
> looks right to clean up that array too. If this isn't the right
> time/patch to do it, please do let me know and I'll take that up separately.
This was probably my mistake. The fix looks good to me!
--
- DML
More information about the core-libs-dev
mailing list