8067801: Enforce null check for underlying I/O streams

Lance Andersen lance.andersen at oracle.com
Wed Jul 17 19:28:20 UTC 2019


Hi Brian,

I think this looks good. 

 I might consider adding the NPE message to the individual classes as it is easy to miss in the 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.


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

HTH

Best
Lance

> On Jul 17, 2019, at 12:12 PM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
> 
> https://bugs.openjdk.java.net/browse/JDK-8067801
> http://cr.openjdk.java.net/~bpb/8067801/webrev.00/
> 
> Add null check to Filter{In,Out}putStream constructors. This covers all the cases listed in the issue as those are all subclasses of these two classes. No javadoc update is need due to this statement in the java.io package doc:
> 
> "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."
> 
> Thanks,
> 
> Brian

 <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif> <http://oracle.com/us/design/oracle-email-sig-198324.gif>
 <http://oracle.com/us/design/oracle-email-sig-198324.gif>Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
Lance.Andersen at oracle.com <mailto:Lance.Andersen at oracle.com>





More information about the core-libs-dev mailing list