lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r890439 - /lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
Date Mon, 14 Dec 2009 18:59:31 GMT
Author: mikemccand
Date: Mon Dec 14 18:59:21 2009
New Revision: 890439

URL: http://svn.apache.org/viewvc?rev=890439&view=rev
Log:
LUCENE-2135: don't flush field cache if we hit exception during init (it leads to NPE)

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java?rev=890439&r1=890438&r2=890439&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java Mon Dec 14 18:59:21
2009
@@ -106,7 +106,6 @@
       segment = si.name;
       this.readBufferSize = readBufferSize;
       this.dir = dir;
-      this.origInstance = origInstance;
 
       boolean success = false;
 
@@ -144,6 +143,12 @@
           decRef();
         }
       }
+
+      // Must assign this at the end -- if we hit an
+      // exception above core, we don't want to attempt to
+      // purge the FieldCache (will hit NPE because core is
+      // not assigned yet).
+      this.origInstance = origInstance;
     }
 
     synchronized TermVectorsReader getTermVectorsReaderOrig() {



Mime
View raw message