RFR: JDK-8265496: improve null check in DeflaterOutputStream/InflaterInputStream [v2]

Lance Andersen lancea at openjdk.java.net
Mon Apr 26 14:58:25 UTC 2021

On Mon, 26 Apr 2021 02:36:54 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> code like below will create Deflater before null check, although it's not a real mem leak, but it's better to do null check before new Deflater.
>>         try {
>>             DeflaterOutputStream dos = new DeflaterOutputStream(null);
>>         } catch (NullPointerException e) {
>>             passed = true;
>>         }
>> Similar issues exist in several other classes.
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>   update copyrights.

Hi Hamlin,

The change looks fine.  Please add the noreg-trivial change to the issue given there is not a test update for this so that you do not get pinged by a bot


Marked as reviewed by lancea (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3681

More information about the core-libs-dev mailing list