Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 5896 invoked from network); 7 Feb 2009 03:16:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2009 03:16:31 -0000 Received: (qmail 90546 invoked by uid 500); 7 Feb 2009 03:16:24 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 90503 invoked by uid 500); 7 Feb 2009 03:16:24 -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 90494 invoked by uid 99); 7 Feb 2009 03:16:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Feb 2009 19:16:24 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yseeley@gmail.com designates 209.85.221.20 as permitted sender) Received: from [209.85.221.20] (HELO mail-qy0-f20.google.com) (209.85.221.20) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Feb 2009 03:16:16 +0000 Received: by qyk13 with SMTP id 13so1558575qyk.5 for ; Fri, 06 Feb 2009 19:15:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:received:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=z5ytl1ySs8VFGLYGERd0vgvsmtXrcsjDeYODQ+w3z/c=; b=TdbY91IG9dAfTdBi1AbU9KkpH2yuB8vOei0wRADvKrpDaMgeex4Q+NqAHGpzOLK6Ax dkVZLOc7GDgPLvFWF8C0gYRut6IPRFRCjg9k0VpyrtMgqQQeJdwSPm41lcDElzPuu0DG cDfnZCQAgQpMqipolmwYcJIfbFt0LXDSa5pAU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:date:x-google-sender-auth:message-id :subject:from:to:content-type:content-transfer-encoding; b=IpoKX71n4PIIEZyfzbpCFre6xJDruJ5LFawhxRnw8C63ATkByNfbEhL2HRRk/Etr1l Sm/8Io/eJ6EFYGcVuEIKFr2OOHZ612Eq2wzknFbiYUK1lafiUwVhLnhZaAU6HfbrjWw1 e9pbUI8n2v4V4glBkBnoIjXIRDkUDlS7thiUA= MIME-Version: 1.0 Sender: yseeley@gmail.com Reply-To: yonik@lucidimagination.com Received: by 10.229.88.195 with SMTP id b3mr944863qcm.75.1233976555887; Fri, 06 Feb 2009 19:15:55 -0800 (PST) Date: Fri, 6 Feb 2009 22:15:55 -0500 X-Google-Sender-Auth: 28f2611cc1cbf9d5 Message-ID: Subject: reopen bug cloning norms for all fields From: Yonik Seeley To: java-dev@lucene.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org After an NPE and a quick gander at SegmentReader, it looks like it's trying to clone the norms for *all* fields, regardless of if they are indexed. The following is the simplest patch that seems to fix things, but I'm wondering if other changes might be warranted (like where fieldNormsChanged is set... should we only check for indexed fields that have norms enabled? or if we should have CHANGED/UNCHANGED/NONE rather than true/false) -Yonik Index: src/java/org/apache/lucene/index/SegmentReader.java =================================================================== --- src/java/org/apache/lucene/index/SegmentReader.java (revision 741813) +++ src/java/org/apache/lucene/index/SegmentReader.java (working copy) @@ -722,7 +722,8 @@ if (doClone || !fieldNormsChanged[i]) { final String curField = fieldInfos.fieldInfo(i).name; Norm norm = (Norm) this.norms.get(curField); - clone.norms.put(curField, norm.clone()); + if (norm != null) + clone.norms.put(curField, norm.clone()); } } --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org