Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 6444 invoked from network); 17 Nov 2008 18:42:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Nov 2008 18:42:37 -0000 Received: (qmail 61166 invoked by uid 500); 17 Nov 2008 18:42:44 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 60789 invoked by uid 500); 17 Nov 2008 18:42:43 -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 60780 invoked by uid 99); 17 Nov 2008 18:42:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Nov 2008 10:42:43 -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; Mon, 17 Nov 2008 18:41:29 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 60A33234C28F for ; Mon, 17 Nov 2008 10:41:44 -0800 (PST) Message-ID: <1733446576.1226947304394.JavaMail.jira@brutus> Date: Mon, 17 Nov 2008 10:41:44 -0800 (PST) From: "Steven Parkes (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (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:comment-tabpanel&focusedCommentId=12648240#action_12648240 ] Steven Parkes commented on LUCENE-689: -------------------------------------- Thanks, Otis. Was just gonna remove myself as assignee. > 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 > 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