lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <>
Subject Re: svn commit: r331111 - /lucene/java/trunk/src/test/org/apache/lucene/search/
Date Mon, 07 Nov 2005 08:14:59 GMT
On Sunday 06 November 2005 18:00, Erik Hatcher wrote:
> I haven't looked at this code in detail, but it seems this resetting  
> could be done in tearDown() of the test cases rather than  
> complicating the tests with try/finally?
> Just a JUnit FYI... tearDown is called after _each_ testXXX method,  
> so if the reset is needed in the middle of a testXXX then try/finally  
> makes sense (though separating into different test methods would be  
> better IMO).

Using tearDown() is indeed cleaner, but has the disadvantage that
changing the flag is done in two different places in the code,
so it could be overlooked by someone using the test code as 
a starting point for their own code.

The actual problem is that this flag in BooleanQuery is static, so an
even better solution would be to make it a normal attribute of each 
BooleanQuery object.

Since the accessing methods are not intended for normal use,
it would also be good to deprecate them now so they can
be easily deleted later.

> >
> > URL:
> > Log:
> > reset useScorer14 in finally in case of test failure
> >
> > Modified:
> >     lucene/java/trunk/src/test/org/apache/lucene/search/ 
> >
> >

Paul Elschot

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message