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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to