opensubscriber
   Find in this group all groups
 
Unknown more information…

l : lucene-dev@jakarta.apache.org 1 March 2005 • 6:42AM -0500

Re: patch - DEFAULT_ vars in IndexWriter non-final and DEFAULT for useCompoundFile
by Doug Cutting

REPLY TO AUTHOR
 
REPLY TO GROUP




Kevin A. Burton wrote:
> Doug Cutting wrote:
>
>> Wolf Siberski wrote:
>>
>>> So, if anything at all, I would rather opt for making these constants
>>> private :-).
>>
>>
>>
>> I agree.  In general, fields should either be final, or private with
>> accessor methods.  So, we could change this to:
>>
>> private static int defaultMergeFactor =
>>   Integer.parseInt(System.getProperty("org.apache.lucene.mergeFactor",
>>                                       "10"));
>>
>> public static int getDefaultMergeFactor() {
>>   return mergeFactor;
>> }
>>
>> public static void setDefaultMergeFactor(int mergeFactor) {
>>   defaultMergeFactor = mergeFactor;
>> }
>
>
> In my original patch I deleted 5 "final" keywords for a reduction in
> code of 25 bytes..   If I were to submit the patch again I'd have to add
> 2 methods and 35 additional lines of code.
>
> Seems to me that the Java coding conventions in this situation should be
> ignored.

This isn't a coding convention, but rather software engineering.  If we
wish to be able to back-compatibly modify Lucene's implementation at a
later date, its usually easiest to have access through methods rather
than fields, since we can intecept reads and writes to the field.

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jaka...
For additional commands, e-mail: lucene-dev-help@jaka...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.