Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8265496

Improve null check in DeflaterOutputStream/InflaterInputStream

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 17
    • core-libs
    • b20

    Description

      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;
              }

      Attachments

        Issue Links

          Activity

            People

              mli Hamlin Li
              mli Hamlin Li
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: