lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: svn commit: r331111 - /lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java
Date Mon, 07 Nov 2005 13:41:21 GMT

On 7 Nov 2005, at 03:14, Paul Elschot wrote:

> 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.

Noted.


> 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.

I agree.  Statics are often more trouble than they're worth.

> 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.

If these methods were added, and I believe they were, after the 1.4.3  
release, then we could just go ahead and remove them and add instance  
methods instead.  Deprecation won't be necessary if they haven't been  
in a released version.

     Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message