[jdom-interest] Element.setAttribute(s)() B7 multiple bugs?

Jason Hunter jhunter at acm.org
Wed Aug 1 12:59:17 PDT 2001


Alex Rosen wrote:
> 
> > Here's the pertinent code:
> >
> >     public Element setAttributes(List attributes) {
> >         // XXX Verify attributes are all parentless first
> >         this.attributes = attributes;
> >         return this;
> >     }
> 
> Hmmm... On an unrelated topic: Doesn't this need some work? First of all, it
> doesn't setParent() on the passed-in Attributes. Second, the List that you
> pass in is now live - changes you make to the List will affect the
> attributes of this element now. Which is different from setContent(List).
> And, for our other live lists (the ones we return), don't we check to make
> sure that subsequently added objects are of the correct type?

Yep, yep, yep, and yep.

-jh-



More information about the jdom-interest mailing list