mirror of
https://github.com/apache/lucene.git
synced 2025-03-04 07:19:18 +00:00
LUCENE-3631: Remove useless nullcheck; don't call doClose from ctor (it's protected and this violates style)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1221840 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b323c54f6a
commit
8913ecf0aa
@ -57,9 +57,9 @@ public final class SegmentReader extends IndexReader {
|
||||
*/
|
||||
public SegmentReader(SegmentInfo si, int termInfosIndexDivisor, IOContext context) throws IOException {
|
||||
this.si = si;
|
||||
core = new SegmentCoreReaders(this, si.dir, si, context, termInfosIndexDivisor);
|
||||
boolean success = false;
|
||||
try {
|
||||
core = new SegmentCoreReaders(this, si.dir, si, context, termInfosIndexDivisor);
|
||||
if (si.hasDeletions()) {
|
||||
// NOTE: the bitvector is stored using the regular directory, not cfs
|
||||
liveDocs = new BitVector(directory(), si.getDelFileName(), new IOContext(IOContext.READ, true));
|
||||
@ -77,7 +77,7 @@ public final class SegmentReader extends IndexReader {
|
||||
// of things that were opened so that we don't have to
|
||||
// wait for a GC to do so.
|
||||
if (!success) {
|
||||
doClose();
|
||||
core.decRef();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -154,9 +154,7 @@ public final class SegmentReader extends IndexReader {
|
||||
@Override
|
||||
protected void doClose() throws IOException {
|
||||
//System.out.println("SR.close seg=" + si);
|
||||
if (core != null) {
|
||||
core.decRef();
|
||||
}
|
||||
core.decRef();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user