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

SequenceInputStream::read(b, off, 0) throws NPE at EOF when b is null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Not an Issue
    • P3
    • tbd
    • 19
    • core-libs
    • b23
    • 19

    Description

      As per the recent spec amendments per https://bugs.openjdk.java.net/browse/JDK-8286675
      "NullPointerException if the end of the last contained stream has not been reached and b is null."

      Expectation :
      So this clarifies that When last contained stream has been reached and the b is null shall not throw NPE instead it should return -1.

      Actual Behavior :
      When last contained stream has been reached and the b is null throws NPE, To result in expected behavior there is a need for one more invocation of read() before this.

      For complete context, refer the attached sample with has comments.




      Attachments

        Issue Links

          Activity

            People

              bpb Brian Burkhalter
              kganapureddy Krushnareddy Ganapureddy
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: