diff --git a/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java b/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java index 55e4fcb9ccf..a857d1371a2 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/sep/SepDocValuesConsumer.java @@ -38,12 +38,10 @@ import org.apache.lucene.util.IOUtils; public class SepDocValuesConsumer extends DocValuesWriterBase { private final Directory directory; - private final FieldInfos fieldInfos; public SepDocValuesConsumer(PerDocWriteState state) throws IOException { super(state); this.directory = state.directory; - fieldInfos = state.fieldInfos; } @Override diff --git a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java index 1491b3213c6..bc8d5d6f0f5 100644 --- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java +++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriterPerThread.java @@ -560,7 +560,7 @@ class DocumentsWriterPerThread { PerDocWriteState newPerDocWriteState(String segmentSuffix) { assert segment != null; - return new PerDocWriteState(infoStream, directory, segment, fieldInfos, bytesUsed, segmentSuffix, IOContext.DEFAULT); + return new PerDocWriteState(infoStream, directory, segment, bytesUsed, segmentSuffix, IOContext.DEFAULT); } @Override diff --git a/lucene/core/src/java/org/apache/lucene/index/PerDocWriteState.java b/lucene/core/src/java/org/apache/lucene/index/PerDocWriteState.java index 6cf21be58a6..64e0b955ee5 100644 --- a/lucene/core/src/java/org/apache/lucene/index/PerDocWriteState.java +++ b/lucene/core/src/java/org/apache/lucene/index/PerDocWriteState.java @@ -33,18 +33,16 @@ public class PerDocWriteState { public final InfoStream infoStream; public final Directory directory; public final String segmentName; - public final FieldInfos fieldInfos; public final Counter bytesUsed; public final String segmentSuffix; public final IOContext context; public PerDocWriteState(InfoStream infoStream, Directory directory, - String segmentName, FieldInfos fieldInfos, Counter bytesUsed, + String segmentName, Counter bytesUsed, String segmentSuffix, IOContext context) { this.infoStream = infoStream; this.directory = directory; this.segmentName = segmentName; - this.fieldInfos = fieldInfos; this.segmentSuffix = segmentSuffix; this.bytesUsed = bytesUsed; this.context = context; @@ -54,7 +52,6 @@ public class PerDocWriteState { infoStream = state.infoStream; directory = state.directory; segmentName = state.segmentName; - fieldInfos = state.fieldInfos; segmentSuffix = state.segmentSuffix; bytesUsed = Counter.newCounter(); context = state.context; @@ -64,7 +61,6 @@ public class PerDocWriteState { this.infoStream = state.infoStream; this.directory = state.directory; this.segmentName = state.segmentName; - this.fieldInfos = state.fieldInfos; this.segmentSuffix = segmentSuffix; this.bytesUsed = state.bytesUsed; this.context = state.context; diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java b/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java index d44e9df16eb..da355fbae6a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCodecs.java @@ -248,11 +248,11 @@ public class TestCodecs extends LuceneTestCase { terms[i] = new TermData(text, docs, null); } - final MutableFieldInfos fieldInfos = new MutableFieldInfos(new MutableFieldInfos.FieldNumberBiMap()); + final MutableFieldInfos builder = new MutableFieldInfos(new MutableFieldInfos.FieldNumberBiMap()); - final FieldData field = new FieldData("field", fieldInfos, terms, true, false); + final FieldData field = new FieldData("field", builder, terms, true, false); final FieldData[] fields = new FieldData[] {field}; - + final FieldInfos fieldInfos = builder.finish(); final Directory dir = newDirectory(); this.write(fieldInfos, dir, fields, true); Codec codec = Codec.getDefault(); @@ -294,16 +294,17 @@ public class TestCodecs extends LuceneTestCase { } public void testRandomPostings() throws Throwable { - final MutableFieldInfos fieldInfos = new MutableFieldInfos(new MutableFieldInfos.FieldNumberBiMap()); + final MutableFieldInfos builder = new MutableFieldInfos(new MutableFieldInfos.FieldNumberBiMap()); final FieldData[] fields = new FieldData[NUM_FIELDS]; for(int i=0;i