[jdom-interest] detach() [eg]

Jools jools at jools.org
Mon Apr 30 15:17:07 PDT 2001


Well what a thread I've started ! I think this even beats the "to be
null or not to be null" thread.

I've read all the arguments and counter arguments over the last 
couple of weeks and I have to say I like the (b) route, which 
was always my 

Having looked at all the use cases once the root element has been
harvested the donor Document is never referenced again, so making
loads of effort to ensure that it's still well formed before we
trash it seems a little crazy. 

Now, can we put this one to bed now ?

--Jools

> 
> No solution above is perfect, but we have to decide and move on.  The
> top two favorites in my mind and that I've heard supported here are (a)
> throwing an exception on root.detach() or (b) allowing the detach() but
> throwing an ISE upon later rootless document use.  Considering the code
> shown above for option (a) in that you would have to create and
> substitute your own bogus element before moving a root, I prefer (b).
> 
> So, unless there are any *new* facts on the topic, I'd like to go with
> (b).



More information about the jdom-interest mailing list