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

A closed JarVerifier.VerifierStream should throw IOException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: core-libs
    • Labels:
      None

      Description

      Colleague Tobias Thierer writes:

      """
      InputStream.read() and available() are specified to throw IOException if the stream has already been closed. JarVerifier.VerifierStream claims to implement InputStream but throws NullPointerException instead.

      The following patch fixes JarVerifier.VerifierStream to throw IOException, rather than NPE, from read() and available() when the stream has already been closed; it also includes a change for the constructor to throw NPE when passed null as the InputStream to delegate to (there's no reason to allow this, and it doesn't seem to be possible to do so via public APIs).
      """

        Attachments

          Activity

            People

            • Assignee:
              martin Martin Buchholz
              Reporter:
              martin Martin Buchholz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: