Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 34775 invoked from network); 4 Dec 2008 11:50:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 11:50:19 -0000 Received: (qmail 7688 invoked by uid 500); 4 Dec 2008 11:50:23 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 7451 invoked by uid 500); 4 Dec 2008 11:50:21 -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 7413 invoked by uid 99); 4 Dec 2008 11:50:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 03:50:21 -0800 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; Thu, 04 Dec 2008 11:48:56 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7F46D234C2C7 for ; Thu, 4 Dec 2008 03:49:44 -0800 (PST) Message-ID: <1378381084.1228391384520.JavaMail.jira@brutus> Date: Thu, 4 Dec 2008 03:49:44 -0800 (PST) From: "Michael McCandless (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Updated: (LUCENE-689) NullPointerException thrown by equals method in SpanOrQuery In-Reply-To: <2491256.1161221734989.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-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael McCandless updated LUCENE-689: -------------------------------------- Fix Version/s: 2.9 > NullPointerException thrown by equals method in SpanOrQuery > ----------------------------------------------------------- > > Key: LUCENE-689 > URL: https://issues.apache.org/jira/browse/LUCENE-689 > Project: Lucene - Java > Issue Type: Bug > Components: Search > Affects Versions: 2.1 > Environment: Java 1.5.0_09, RHEL 3 Linux, Tomcat 5.0.28 > Reporter: Michael Goddard > Assignee: Otis Gospodnetic > Priority: Minor > Fix For: 2.9 > > Attachments: LUCENE-689.txt > > > Part of our code utilizes the equals method in SpanOrQuery and, in certain cases (details to follow, if necessary), a NullPointerException gets thrown as a result of the String "field" being null. After applying the following patch, the problem disappeared: > Index: src/java/org/apache/lucene/search/spans/SpanOrQuery.java > =================================================================== > --- src/java/org/apache/lucene/search/spans/SpanOrQuery.java (revision 465065) > +++ src/java/org/apache/lucene/search/spans/SpanOrQuery.java (working copy) > @@ -121,7 +121,8 @@ > final SpanOrQuery that = (SpanOrQuery) o; > if (!clauses.equals(that.clauses)) return false; > - if (!field.equals(that.field)) return false; > + if (field != null && !field.equals(that.field)) return false; > + if (field == null && that.field != null) return false; > return getBoost() == that.getBoost(); > } -- 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