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

Alan Bateman Alan.Bateman at oracle.com
Mon Jan 26 11:52:35 UTC 2015

On 23/01/2015 19:17, Brian Burkhalter wrote:
> Here’s an updated patch including a (perhaps overkill) test:
> http://cr.openjdk.java.net/~bpb/6880737/webrev.01/ 
> <http://cr.openjdk.java.net/%7Ebpb/6880737/webrev.01/>
Thanks, the null check is fine. The webrev still has the javadoc change, 
it looks okay but not needed.

The test needs to be moved into a FileLock sub-directory to keep the 
current organization consistent.  As it's become a unit test for 
FileLock then I think it would be a bit clearer as a TestNG test but not 
strictly required. One thing that would be good is to switch the test to 
using FileChannel.open and to use try-with-resources. The catching of 
Exception can probably be dropped too, the test will fail if 
un-documented exceptions are throw.


More information about the core-libs-dev mailing list