lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yonik Seeley <>
Subject reopen bug cloning norms for all fields
Date Sat, 07 Feb 2009 03:15:55 GMT
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
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)


Index: src/java/org/apache/lucene/index/
--- src/java/org/apache/lucene/index/ (revision 741813)
+++ src/java/org/apache/lucene/index/ (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:
For additional commands, e-mail:

View raw message