commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: [commons]NPE or IAE?
Date Thu, 22 Aug 2002 01:13:45 GMT wrote on 22/08/2002 10:02:14 AM:

> dion writes:
> >NPEs for the illegal nulls. From the JDK docs:
> >Thrown when an application attempts to use null in a case where an 
> >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. 
> Sure, we know that. 
> But also from the JDK docs:
> IllegalArgumentException:
> Thrown to indicate that a method has been passed an illegal or 
> inappropriate argument. 
> If using null as an argument is illegal in some method, it is _both_
> an illegal use of null, as well as an inappropriate/illegal 
> argument, so the question remains open. 
Ok, but that was my vote and reasoning........

> I asked if and how commons would like to close this question for 
> themselves (since I am contributing and would like to know the 
> commons view). I\'ve seen and used both approaches and have no 
> _problem_ with any of them (but I favor the IAE-only way since it 
> seems more logical).
As a committer on commons I was responding with my vote and reasoning, I 
favour using both....

> Thanks for your valuable input.
No worries.....
dIon Gillard, Multitask Consulting

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