[jdom-interest] Bug in Document.setRootElement

Brett McLaughlin brett.mclaughlin at lutris.com
Thu Jun 8 23:37:27 PDT 2000


Rick Nucci wrote:
> 
> In the Jun-5 build, it seems like Document.setRootElement is wrong:
> (Sorry if this has already been logged)
> 
> public Document setRootElement(Element rootElement) {
>          // If existing root element, tell it that it's no longer root
>          if (this.rootElement != null) {
>              rootElement.setIsRootElement(false);
>          }
> 
>          this.rootElement = rootElement;
> 
>          if (rootElement != null) {
>              rootElement.setIsRootElement(true);
>              content.add(rootElement);
>          }
> 
>          return this;
>      }
> 
> Shouldn't it be:
> 
> // If existing root element, tell it that it's no longer root
>          if (this.rootElement != null) {
>              this.rootElement.setIsRootElement(false);
>          }
> 

This may be a duplicate, as I fixed this with jason and am not sure if
he sent something - yes, this was a bug, and we fixed it. Good catch -
this actually caused big problems if you tried to set a root, change the
root, and use the original root again. Nice...

-Brett

> Rick
> 
> ______________________________________________
> 
> Rick Nucci
> Partner, Boomi Inc.
> rick_nucci at boomi.com
> http://www.boomi.com
> _______________________________________________
> 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