What should Path.getAttribute(null) do?

Alan Bateman Alan.Bateman at Sun.COM
Fri Nov 6 11:41:51 PST 2009

Joel Uckelman wrote:
> What should Path.getAttribute(null) do? Plausible options seem to be:
> 1. Throw an IllegalArgumentException.
> 2. Throw a NullPointerException.
> 3. Return null.
> The docs don't specify any behavior.
It should throw NPE (To avoid clutter in the javadoc there is a 
statement in the package description that states that, unless otherwise 
specified, then passing a null argument to a constructor or method of 
any class or interface in the package will cause a NPE to be thrown).


More information about the nio-dev mailing list