That's likely a better approach. A challenge is that our API doesn't make it very obvious. For instance, I'm helping to debug some internal code that ended up doing the following:
Link link = Factory.INSTANCE.newLink(feed); ... feed.addLink(link); The newLink adds the link to the feed when the link is created. The addLink(link) causes it to be added again. - James Garrett Rooney wrote: > On 8/21/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Author: jmsnell >> Date: Mon Aug 21 13:20:36 2006 >> New Revision: 433345 >> >> URL: http://svn.apache.org/viewvc?rev=433345&view=rev >> Log: >> If an element already contains a child, don't add it again. > > Why would there be any code doing this? It seems like the kind of > case that's only an error, should we really let it happen and slow > everything down with the extra if, or should we just fix the code that > tries to do it? > > -garrett >
