lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ganyo <scott.ga...@eTapestry.com>
Subject Proposed changes to SegmentsReader and TermInfosReader
Date Wed, 10 Oct 2001 16:10:14 GMT
I'm getting a NullPointerException when a requested Term is greater than
(using compareTo) all existing Terms in a given segment.  Here are my
proposed changes:

[Index: SegmentsReader.java]
[===================================================================]
[RCS file:
/home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentsReader.jav
a,v]
[retrieving revision 1.1.1.1]
[diff -r1.1.1.1 SegmentsReader.java]
[181,191c182,195]
[<       if (t != null) {]
[< 	termEnum = (SegmentTermEnum)reader.terms(t);]
[<       } else]
[< 	termEnum = (SegmentTermEnum)reader.terms();]
[<       ]
[<       SegmentMergeInfo smi = new SegmentMergeInfo(starts[i], termEnum,
reader);]
[<       if (t == null ? smi.next() : termEnum.term() != null)]
[< 	queue.put(smi);				  // initialize queue]
[<       else]
[< 	smi.close();]
[<     }]
[---]
[>            if (t != null) {]
[>                termEnum = (SegmentTermEnum)reader.terms(t);]
[>            } else {]
[>                termEnum = (SegmentTermEnum)reader.terms();]
[>            }]
[>            ]
[>            if (termEnum != null) {]
[>                SegmentMergeInfo smi = new SegmentMergeInfo(starts[i],
termEnum, reader);]
[>                if (t == null ? smi.next() : termEnum.term() != null)]
[>                    queue.put(smi);				  //
initialize queue]
[>                else]
[>                    smi.close();]
[>            }]
[>        }]


[Index: TermInfosReader.java]
[===================================================================]
[RCS file:
/home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/TermInfosReader.ja
va,v]
[retrieving revision 1.1.1.1]
[diff -r1.1.1.1 TermInfosReader.java]
[217c217]
[<     get(term);					  // seek enum to
term]
[---]
[>     if (get(term) == null) return null;	 // seek enum to term]


Please let me know if you see a problem with the change.  Otherwise, I'll
check it in tomorrow.

Thanks,
Scott

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message