[jdom-interest] [Vote] NoSuchChildException

Kevin Regan kevinr at valicert.com
Thu Jul 13 12:11:02 PDT 2000


Wow, I've really enjoyed this discussion, but I think it
might be time to move on (50% of my mail has been
"Re: [jdom-interest] [Vote] NoSuchChildException").
Even though I would have voted for NoSuchChildException,
I don't have a huge problem with null (anything to get
my mailbox back to normal again... :-) ).

--Kevin

On Thu, 13 Jul 2000, Alex Chaffee wrote:

> >  Oh, wait, no, it only makes sense
> > because in this case (getFirst() and getLast()) "null" has a different
> > meaning.  It means "the first item in the list is null", not "there is
> > no first item since the list is empty."
> 
> That also justifies its use in Iterator.  Since a collection may
> contain null entries, you need an out-of-band way to signify "end of
> list" as separate from "entry is null."  You will note that the
> API-prescribed way to signify that is the hasNext() method.  The
> exception is only thrown in the *exceptional* case that the programmer
> ignored the result of hasNext().  (Which is a RuntimeException since
> the programmer messed up.)
> 
> Kid Tested, Mother Approved -
> 
>  - Alex
> 
> -- 
> Alex Chaffee                       mailto:alex at jguru.com
> jGuru - Java News and FAQs         http://www.jguru.com/alex/
> Creator of Gamelan                 http://www.gamelan.com/
> Founder of Purple Technology       http://www.purpletech.com/
> Curator of Stinky Art Collective   http://www.stinky.com/
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@you
> rhost.com
> 




More information about the jdom-interest mailing list