[9] RFR of 6880737: (fs) FileLock constructors don't throw NPE if the channel argument is null

Alan Bateman Alan.Bateman at oracle.com
Sat Jan 17 07:33:48 UTC 2015

On 17/01/2015 00:02, Brian Burkhalter wrote:
> Hello,
> Please review at your convenience.
> Issue:	https://bugs.openjdk.java.net/browse/JDK-6880737
> Patch:	http://cr.openjdk.java.net/~bpb/6880737/webrev.00/
> This is a minor change to check the channel parameter of FileLock(). Although this class is public, a non-JDK subclass does not appear to be able to be used via any JDK API so the effect of the change should be innocuous. The minor change to the channel parameter specification should not, I would think, merit a CCC request.
The change to the javadoc isn't strictly required as there is a general 
statement in the package description that NPE be thrown when methods or 
constructors are called with null.

So the implementation should throw NPE rather than IAE and as it's an 
incompatible change then it should be tracked. It's important to add a 
test case too.


More information about the core-libs-dev mailing list