[jdom-interest] Parents - why do we need them?

philip.nelson at omniresources.com philip.nelson at omniresources.com
Tue Jul 3 07:39:28 PDT 2001

> NO! NO! NO! Are we really just filtering them out? How awful, 
> whether we do it on insertion or output. If a JTextBox is 
> getting added to an Element, then something very weird is 
> going on. We need to alert the developer of this in the 
> standard Java way by throwing an exception, possibly a 
> runtime exception since this is so weird, but definitely we 
> should throw an exception. We should not sweep the problem 
> under the rug by letting it silently fail. 


I was pretty sure you weren't going to like this idea!  No, we are not
currently filtering them out.  The attributes list has almost no checking at
all and happily takes nulls.  Null handling in general is a TODO.  Other
checking is waiting on the FilterList implementation.  Most of the
parent/namespace checks probably blow up now if you insert something not
intended for JDOM.  I'll add tests for this and see how bad it is.  At the
least the outputters will blow up now.

But as to the general idea, I have started to feel that all this checking we
do, while great for newbies, is a pain in general.  We went through this
discussion a bit when we were talking about setting the root element to
null/placeholder.  To, having an invalid document in memory seems to matter.
To me, being able to easily output a valid document matters, and what is in
memory is less important.

I definately don't care enough about it to have a long battle so unless
somebody else speaks up and says they like the idea, it's dead.

More information about the jdom-interest mailing list