commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [commons]NPE or IAE?
Date Wed, 21 Aug 2002 23:47:55 GMT wrote on 22/08/2002 06:23:17 AM:

> A quickie.
> When contributing new code directly to Commons, would you like me to
> use IllegalArgumentException for all illegal arguments to a method, 
> or NullPointerException for the illegal nulls?
NPEs for the illegal nulls. From the JDK docs:
Thrown when an application attempts to use null in a case where an object 
is required. These include: 
Calling the instance method of a null object. 
Accessing or modifying the field of a null object. 
Taking the length of null as if it were an array. 
Accessing or modifying the slots of null as if it were an array. 
Throwing null as if it were a Throwable value. 
Applications should throw instances of this class to indicate other 
illegal uses of the null object. 

> Preferences, anybody?
dIon Gillard, Multitask Consulting

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message