RFR [14] JDK-8225763 Inflater and Deflater should implement AutoCloseable

Jaikiran Pai jai.forums2013 at gmail.com
Wed Jul 10 06:58:08 UTC 2019


On 09/07/19 8:44 PM, David Lloyd wrote:
> 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!


Thank you David.

-Jaikiran



More information about the core-libs-dev mailing list