8067801: Enforce null check for underlying I/O streams

Brian Burkhalter brian.burkhalter at oracle.com
Wed Jul 17 19:35:08 UTC 2019


Hi Lance,

> On Jul 17, 2019, at 12:28 PM, Lance Andersen <lance.andersen at oracle.com> wrote:
> 
> I think this looks good. 

Thanks.

> I might consider adding the NPE message to the individual classes as it is easy to miss in the java.io <http://java.io/> package but that is just a suggestion.  Especially with the new search feature of javadoc, I usually go straight to the method so would never see the info in the package comments.

It might be better but I don’t know where else in java.io an NPE is thrown without being documented on the ctor/method itself. If there are other places then a general inspection might be in order.

Note that the practice of using the package-level doc occurs also in java.nio:

"Unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package will cause a NullPointerException to be thrown."

> Did you give any thought of using TestNG/assertThrows?  Not a big deal, I just a personal preference :-)

I don’t see how that would work in this case as we do *not* expect an exception.

Thanks,

Brian


More information about the core-libs-dev mailing list