Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 98666 invoked from network); 28 Mar 2008 09:08:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Mar 2008 09:08:42 -0000 Received: (qmail 44411 invoked by uid 500); 28 Mar 2008 09:08:39 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 44363 invoked by uid 500); 28 Mar 2008 09:08:39 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 44352 invoked by uid 99); 28 Mar 2008 09:08:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 02:08:39 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 09:07:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 99230234C0A8 for ; Fri, 28 Mar 2008 02:06:24 -0700 (PDT) Message-ID: <200311164.1206695184625.JavaMail.jira@brutus> Date: Fri, 28 Mar 2008 02:06:24 -0700 (PDT) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Resolved: (LUCENE-1247) Unnecessary assert in org.apache.lucene.index.DocumentsWriterThreadState.trimFields() In-Reply-To: <1825593119.1206646284824.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-1247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael McCandless resolved LUCENE-1247. ---------------------------------------- Resolution: Fixed Fix Version/s: 2.4 Thanks David, I just removed this. > Unnecessary assert in org.apache.lucene.index.DocumentsWriterThreadState.trimFields() > ------------------------------------------------------------------------------------- > > Key: LUCENE-1247 > URL: https://issues.apache.org/jira/browse/LUCENE-1247 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Affects Versions: 2.3.1, 2.3.2 > Reporter: David Dillard > Priority: Trivial > Fix For: 2.4 > > > In org.apache.lucene.index.DocumentsWriterThreadState.trimFields() is the following code: > if (fp.lastGen == -1) { > // This field was not seen since the previous > // flush, so, free up its resources now > // Unhash > final int hashPos = fp.fieldInfo.name.hashCode() & fieldDataHashMask; > DocumentsWriterFieldData last = null; > DocumentsWriterFieldData fp0 = fieldDataHash[hashPos]; > while(fp0 != fp) { > last = fp0; > fp0 = fp0.next; > } > assert fp0 != null; > The assert at the end is not necessary as fp0 cannot be null. The first line in the above code guarantees that fp is not null by the time the while loop is hit. The while loop is exited when fp0 and fp are equal. Since fp is not null then fp0 cannot be null when the while loop is exited, thus the assert is guaranteed to never occur. > This was detected by FindBugs. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org