lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gol...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/index SegmentTermEnum.java SegmentTermDocs.java
Date Mon, 19 Apr 2004 14:46:00 GMT
goller      2004/04/19 07:46:00

  Modified:    src/java/org/apache/lucene/index SegmentTermEnum.java
                        SegmentTermDocs.java
  Log:
  fixed a potential problem concerning optimized
  TermDocs.seek
  
  Revision  Changes    Path
  1.6       +1 -1      jakarta-lucene/src/java/org/apache/lucene/index/SegmentTermEnum.java
  
  Index: SegmentTermEnum.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentTermEnum.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SegmentTermEnum.java	29 Mar 2004 22:48:02 -0000	1.5
  +++ SegmentTermEnum.java	19 Apr 2004 14:46:00 -0000	1.6
  @@ -21,7 +21,7 @@
   
   final class SegmentTermEnum extends TermEnum implements Cloneable {
     private InputStream input;
  -  private FieldInfos fieldInfos;
  +  FieldInfos fieldInfos;
     long size;
     long position = -1;
   
  
  
  
  1.10      +4 -1      jakarta-lucene/src/java/org/apache/lucene/index/SegmentTermDocs.java
  
  Index: SegmentTermDocs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentTermDocs.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SegmentTermDocs.java	29 Mar 2004 22:48:02 -0000	1.9
  +++ SegmentTermDocs.java	19 Apr 2004 14:46:00 -0000	1.10
  @@ -54,10 +54,13 @@
   
     public void seek(TermEnum enum) throws IOException {
       TermInfo ti;
  -    if (enum instanceof SegmentTermEnum)          // optimized case
  +    
  +    // use comparison of fieldinfos to verify that enum belongs to the same segment as
this SegmentTermDocs
  +    if (enum instanceof SegmentTermEnum && ((SegmentTermEnum) enum).fieldInfos
== parent.fieldInfos)          // optimized case
         ti = ((SegmentTermEnum) enum).termInfo();
       else                                          // punt case
         ti = parent.tis.get(enum.term());
  +      
       seek(ti);
     }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message