abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: svn commit: r433345 - in /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax: FOMElement.java FOMFeed.java
Date Mon, 21 Aug 2006 20:56:46 GMT
On 8/21/06, James M Snell <jasnell@gmail.com> wrote:
> 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.

Perhaps an assert instead of the if, so people can at least find the
problem when they make that mistake?  I'm not sure how this sort of
thing is usually handled in Java...

FWIW, it probably doesn't help that Factor.newLink(Element) doesn't
actually have any javadoc, so there's no way for anyone to know that
it adds the link to the element unless they've read the source.

-garrett

Mime
View raw message