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

Jason Hunter jhunter at collab.net
Wed Aug 30 01:35:28 PDT 2000


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@yourhost.com



More information about the jdom-interest mailing list