lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@lucene.com>
Subject Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/store FSDirectory.java
Date Mon, 24 Jun 2002 16:39:11 GMT
otis@apache.org wrote:
[ ... ]
>   +  private static final boolean DISABLE_LOCKS = Boolean.getBoolean("disableLocks");
[ ... ]
>    	public boolean obtain() throws IOException {
>   -          if (Constants.JAVA_1_1) return true;    // locks disabled in jdk 1.1
>   +          if (Constants.JAVA_1_1)
>   +	      return true;    // locks disabled in jdk 1.1
>   +	  if (DISABLE_LOCKS)
>   +	      return true;
>              return lockFile.createNewFile();
>    	}

It would be simpler to just define DISABLE_LOCKS as:

   private static final boolean DISABLE_LOCKS
     Boolean.getBoolean("disableLocks") || Constants.JAVA_1_1;

Then obtain() and release() can just have one check, of the form:

    if (DISABLE_LOCKS)
      ...

Also, documentation of the "disableLocks" property should be added to 
FSDirectory's javadoc.  We don't want undocumented features!

Doug


--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message