[jdom-interest] Moving Subtrees using JDOM

bob mcwhirter bob at werken.com
Sat Feb 23 21:24:37 PST 2002


Yah...  I apparently read Jason's email too quickly (and
insufficiently).  I read that he wanted to change addContent(Element)
to reparent, and stop throwing exceptions.

Mea culpa.

	-bob

On Sat, 23 Feb 2002, Hallvard Tratteberg wrote:

> Bob,
> 
> > > And my gut instinct is addContent(Element) shouldn't be changed
> > > to remove children from parents.
> >
> > I disagree.
> >
> > I've seen naive programmer create an Element, and then attempt to
> > re-use it (across threads, or whatnot) and attach it to multiple
> > documents.  With the exception, the problem became clear rather
> > quickly.  Without an exception, using auto-reparenting, you'd
> > simply end up with documents that didn't contain the Element
> > you thought you'd added (and never explicitly removed).
> 
> Jason writes "addContent(Element) shouldn't be changed to remove children
> from parents". Isn't that what you also say? I read it that "Without an
> exception, using auto-reparenting, you'd simply end up with documents that
> didn't contain the Element you thought you'd added (and never explicitly
> removed)." is a bad thing, so you actually agree???
> 
> Hallvard
> 




More information about the jdom-interest mailing list