LUCENE-6246: fix missed checks on PostingsEnum.POSITIONS

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1662129 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan Ernst 2015-02-24 22:16:10 +00:00
parent 2cd3fb807d
commit d59b1e944a
5 changed files with 6 additions and 6 deletions

View File

@ -860,7 +860,7 @@ public final class DirectPostingsFormat extends PostingsFormat {
// TODO: implement reuse
// it's hairy!
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
if (!hasPos) {
return null;
}
@ -1454,7 +1454,7 @@ public final class DirectPostingsFormat extends PostingsFormat {
public PostingsEnum postings(Bits liveDocs, PostingsEnum reuse, int flags) {
// TODO: implement reuse
// it's hairy!
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
if (!hasPos) {
return null;
}

View File

@ -829,7 +829,7 @@ public final class MemoryPostingsFormat extends PostingsFormat {
@Override
public PostingsEnum postings(Bits liveDocs, PostingsEnum reuse, int flags) {
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
if (field.getIndexOptions().compareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0) {
return null;
}

View File

@ -937,7 +937,7 @@ public final class CompressingTermVectorsReader extends TermVectorsReader implem
@Override
public final PostingsEnum postings(Bits liveDocs, PostingsEnum reuse, int flags) throws IOException {
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
if (positions == null && startOffsets == null)
return null;
}

View File

@ -194,7 +194,7 @@ public final class Lucene50PostingsReader extends PostingsReaderBase {
@Override
public PostingsEnum postings(FieldInfo fieldInfo, BlockTermState termState, Bits liveDocs, PostingsEnum reuse, int flags) throws IOException {
if ((flags & PostingsEnum.POSITIONS) < PostingsEnum.POSITIONS) {
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS) == false) {
BlockDocsEnum docsEnum;
if (reuse instanceof BlockDocsEnum) {
docsEnum = (BlockDocsEnum) reuse;

View File

@ -235,7 +235,7 @@ class FreqProxFields extends Fields {
throw new IllegalArgumentException("liveDocs must be null");
}
if ((flags & PostingsEnum.POSITIONS) >= PostingsEnum.POSITIONS) {
if (PostingsEnum.featureRequested(flags, PostingsEnum.POSITIONS)) {
FreqProxPostingsEnum posEnum;
if (!terms.hasProx) {