lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r746343 - in /lucene/java/trunk/src/java/org/apache/lucene/index: MultiSegmentReader.java SegmentReader.java
Date Fri, 20 Feb 2009 19:37:26 GMT
Author: mikemccand
Date: Fri Feb 20 19:37:25 2009
New Revision: 746343

URL: http://svn.apache.org/viewvc?rev=746343&view=rev
Log:
LUCENE-1314: add asserts during *Reader.clone() that the incoming SegmentInfo/s matches the
current reader

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

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java?rev=746343&r1=746342&r2=746343&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/MultiSegmentReader.java Fri Feb 20
19:37:25 2009
@@ -106,6 +106,10 @@
       try {
         SegmentReader newReader;
         if (newReaders[i] == null || infos.info(i).getUseCompoundFile() != newReaders[i].getSegmentInfo().getUseCompoundFile())
{
+
+          // We should never see a totally new segment during cloning
+          assert !doClone;
+
           // this is a new reader; in case we hit an exception we can close it safely
           newReader = SegmentReader.get(readOnly, infos.info(i));
         } else {

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=746343&r1=746342&r2=746343&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 Fri Feb 20 19:37:25
2009
@@ -671,6 +671,10 @@
       return this;
     }    
 
+    // When cloning, the incoming SegmentInfos should not
+    // have any changes in it:
+    assert !doClone || (normsUpToDate && deletionsUpToDate);
+
     // clone reader
     SegmentReader clone;
     try {



Mime
View raw message