lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r903742 - /lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
Date Wed, 27 Jan 2010 17:16:45 GMT
Author: mikemccand
Date: Wed Jan 27 17:16:45 2010
New Revision: 903742

URL: http://svn.apache.org/viewvc?rev=903742&view=rev
Log:
don't throw NPE if an exception is hit while init'ing the core readers in SegmentReader

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=903742&r1=903741&r2=903742&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 Wed Jan 27 17:16:45
2010
@@ -242,8 +242,12 @@
           storeCFSReader.close();
         }
 
-        // Force FieldCache to evict our entries at this point
-        if (freqStream != null) {
+        // Force FieldCache to evict our entries at this
+        // point.  If the exception occurred while
+        // initialzing the core readers, then
+        // origInstance will be null, and we don't want
+        // to call FieldcAche.purge (it leads to NPE):
+        if (origInstance != null) {
           FieldCache.DEFAULT.purge(origInstance);
         }
       }



Mime
View raw message