Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 4128 invoked from network); 24 Jun 2002 16:39:07 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 24 Jun 2002 16:39:07 -0000 Received: (qmail 29024 invoked by uid 97); 24 Jun 2002 16:39:15 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@jakarta.apache.org Received: (qmail 28953 invoked by uid 97); 24 Jun 2002 16:39:13 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 28903 invoked by uid 98); 24 Jun 2002 16:39:12 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <3D174B2F.3080704@lucene.com> Date: Mon, 24 Jun 2002 09:39:11 -0700 From: Doug Cutting User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lucene Developers List Subject: Re: cvs commit: jakarta-lucene/src/java/org/apache/lucene/store FSDirectory.java References: <20020621145746.49307.qmail@icarus.apache.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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: For additional commands, e-mail: