Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 75394 invoked from network); 28 Feb 2007 18:39:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Feb 2007 18:39:20 -0000 Received: (qmail 31513 invoked by uid 500); 28 Feb 2007 18:39:26 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 31469 invoked by uid 500); 28 Feb 2007 18:39:26 -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 31458 invoked by uid 99); 28 Feb 2007 18:39:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2007 10:39:26 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2007 10:39:17 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DB0FB714042 for ; Wed, 28 Feb 2007 10:38:56 -0800 (PST) Message-ID: <6297703.1172687936879.JavaMail.jira@brutus> Date: Wed, 28 Feb 2007 10:38:56 -0800 (PST) From: "Doug Cutting (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Commented: (LUCENE-819) NullPointerException in Term.compareTo() In-Reply-To: <9238613.1172592725549.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-819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476667 ] Doug Cutting commented on LUCENE-819: ------------------------------------- > why not just apply the patch and move on? Two reasons: (1) most folks consider it an error to use null for a term's text, an error that unfortunately wasn't checked in the constructor, but causes problems in the comparator, when reading and writing, etc.--basically everywhere a term is used. Your application only uses such terms in comparators, so you're only concerned about that case, but there are more cases, and if null is officially supported they should all be fixed; and (2) adding complexity to an inner-loop comparator should not be done lightly as it may have performance implications. > NullPointerException in Term.compareTo() > ---------------------------------------- > > Key: LUCENE-819 > URL: https://issues.apache.org/jira/browse/LUCENE-819 > Project: Lucene - Java > Issue Type: Bug > Components: Index > Environment: JDK 1.4 on MacOS > Reporter: Dan Zivkovic > Attachments: lucene-819.patch, lucene-819.patch, TestTerm.java > > > java.lang.NullPointerException > at org.apache.lucene.index.Term.compareTo(Term.java:84) > at org.apache.lucene.index.TermInfosReader.getIndexOffset(TermInfosReader.java:115) > at org.apache.lucene.index.TermInfosReader.get(TermInfosReader.java:150) > at org.apache.lucene.index.SegmentReader.docFreq(SegmentReader.java:300) > at org.apache.lucene.search.IndexSearcher.docFreq(IndexSearcher.java:78) > at org.apache.lucene.search.Similarity.idf(Similarity.java:255) > at org.apache.lucene.search.TermQuery$TermWeight.(TermQuery.java:43) > at org.apache.lucene.search.TermQuery.createWeight(TermQuery.java:142) > at org.apache.lucene.search.BooleanQuery$BooleanWeight.(BooleanQuery.java:203) > at org.apache.lucene.search.BooleanQuery$BooleanWeight2.(BooleanQuery.java:330) > at org.apache.lucene.search.BooleanQuery.createWeight(BooleanQuery.java:372) > at org.apache.lucene.search.Query.weight(Query.java:93) > at org.apache.lucene.search.Hits.(Hits.java:48) > at org.apache.lucene.search.Searcher.search(Searcher.java:53) > ... -- 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