[jdom-interest] detach() [eg]

bob mcwhirter bob at werken.com
Tue Apr 17 14:06:28 PDT 2001


<placeholder/> seems evil to me.

Most 'sentinal' marker values are odd, though, to me.

+1 for null.

	-bob

On Tue, 17 Apr 2001, Jools wrote:

> 
> Whilst working through the source code for Element.java I became
> uncomfortable
> with the detach() method.
> 
>     public Element detach() {
>         Element p = getParent();
>         if (p != null) {
>             p.removeContent(this);
>         }
>         else {
>             Document d = getDocument();
>             if (d != null) {
>                 d.setRootElement(new Element("placeholder"));
>             }
>         }
>         return this;
>     }
> 
> Which means that if we detach a root element from Document it ends
> up being a document with one root element <placeholder/>.
> 
> Do we really want this, or should we simply set the root Element to
> null ?
> 
> 
> --Jools
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
> 




More information about the jdom-interest mailing list