[jdom-interest] How to "crash" JDOM, part 1

trebor.a.rude at lmco.com trebor.a.rude at lmco.com
Wed Aug 30 08:27:12 PDT 2000


The problem here isn't getCopy(), it's that he added the copy as a child of
itself, which shouldn't be allowed.

Trebor A. Rude
trebor.a.rude at lmco.com

> -----Original Message-----
> From:	Jason Hunter [SMTP:jhunter at collab.net]
> Sent:	Wednesday, August 30, 2000 2:35 AM
> To:	Aleksi Kallio
> Cc:	jdom-interest at jdom.org
> Subject:	Re: [jdom-interest] How to "crash" JDOM, part 1
> 
> This shouldn't cause an infinite loop.  The getCopy() should do a deep
> clone and therefore should be like any other element.  An infinite loop
> is a bug.  I'll look at it when I have time, but if you want faster
> action feel free to look into what's going wrong yourself!  :-)
> 
> -jh-
> 
> Aleksi Kallio wrote:
> > 
> > This little bit of software makes JDOM (or XMLOutputter, to be precise)
> to enter an infite loop (built against a week old CVS). The code is of
> course a result of an evil mistake, but anyway, shouldn't the behaviour be
> better defined?
> > 
> >   Element element = new Element("looped");
> > 
> >   Element copy = element.getCopy("copy");
> >   copy.addContent(copy); // bang!
> > 
> >   new XMLOutputter().output(new Document(copy), System.out);
> > 
> > _______________________________________________
> > To control your jdom-interest membership:
> >
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourh
> ost.com
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourh
> ost.com



More information about the jdom-interest mailing list