abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: Failing tests (was Re: <content src=>)
Date Tue, 08 Aug 2006 18:04:20 GMT
On 8/8/06, Ugo Cei <ugo.cei@gmail.com> wrote:
>
> On Aug 8, 2006, at 7:53 PM, Garrett Rooney wrote:
>
> > Sounds promising, but...
> >
> >  @Override
> >  public ParserOptions getDefaultParserOptions() {
> >    return new FOMParserOptions();
> >  }
> >
> > That's from FOMParser.java, and FOMParserOptions doesn't seem to have
> > anything odd in it.
>
> Huh? My copy (rev. 429578) has:
>
>    @Override
>    public ParserOptions getDefaultParserOptions() {
>      if (options == null)
>        options = new FOMParserOptions();
>      return options;
>    }
>
> And this is indeed the problem, since I've modified the tests (patch
> attached) to make sure options are reset after every test (should
> probably use tearDown, though) and the tests now succeeed.

Ahh, recent change, I was looking at an older working copy.

I'd say that a more correct change would be to return a copy of the
options, instead of a reference to the default one, but that's just
me.  It seems like modifying the ParserOptions you get from
getDefaultParserOptions shouldn't change the defaults for everyone
else.

-garrett

Mime
View raw message