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

Hamlin Li mli at openjdk.java.net
Mon Apr 26 02:36:54 UTC 2021

> 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.


  - all: https://git.openjdk.java.net/jdk/pull/3681/files
  - new: https://git.openjdk.java.net/jdk/pull/3681/files/25a88c61..38c45b62

 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3681&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3681&range=00-01

  Stats: 8 lines in 8 files changed: 0 ins; 0 del; 8 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3681.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3681/head:pull/3681

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

More information about the core-libs-dev mailing list