diff --git a/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndexNormDocValues.java b/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndexNormDocValues.java index d5f8222f653..36a3f9d5d8e 100644 --- a/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndexNormDocValues.java +++ b/lucene/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndexNormDocValues.java @@ -43,8 +43,8 @@ class MemoryIndexNormDocValues extends DocValues { } @Override - public Type type() { - return source.type(); + public Type getType() { + return source.getType(); } @Override diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xNormsProducer.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xNormsProducer.java index 7ceddee201b..045173d5e00 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xNormsProducer.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xNormsProducer.java @@ -235,7 +235,7 @@ class Lucene3xNormsProducer extends PerDocProducer { } @Override - public Type type() { + public Type getType() { return Type.FIXED_INTS_8; } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Bytes.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Bytes.java index d73bd46c1af..4ab1bd9e4b9 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Bytes.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Bytes.java @@ -363,7 +363,7 @@ public final class Bytes { } @Override - public Type type() { + public Type getType() { return type; } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedDerefBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedDerefBytesImpl.java index 0d5d549eb7d..7c745b93b0c 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedDerefBytesImpl.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedDerefBytesImpl.java @@ -84,7 +84,7 @@ class FixedDerefBytesImpl { @Override public Source getDirectSource() throws IOException { - return new DirectFixedDerefSource(cloneData(), cloneIndex(), size, type()); + return new DirectFixedDerefSource(cloneData(), cloneIndex(), size, getType()); } @Override diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedStraightBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedStraightBytesImpl.java index 8d2bb7e199c..4ea4b46e257 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedStraightBytesImpl.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/FixedStraightBytesImpl.java @@ -287,7 +287,7 @@ class FixedStraightBytesImpl { @Override public Source getDirectSource() throws IOException { - return new DirectFixedStraightSource(cloneData(), size, type()); + return new DirectFixedStraightSource(cloneData(), size, getType()); } @Override diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Floats.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Floats.java index b46669518db..4d3e0548e7d 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Floats.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Floats.java @@ -84,7 +84,7 @@ public class Floats { @Override protected boolean tryBulkMerge(DocValues docValues) { // only bulk merge if value type is the same otherwise size differs - return super.tryBulkMerge(docValues) && docValues.type() == template.type(); + return super.tryBulkMerge(docValues) && docValues.getType() == template.getType(); } @Override diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Ints.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Ints.java index 4b5c22600fd..22875ad5a73 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Ints.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/Ints.java @@ -121,7 +121,7 @@ public final class Ints { @Override protected boolean tryBulkMerge(DocValues docValues) { // only bulk merge if value type is the same otherwise size differs - return super.tryBulkMerge(docValues) && docValues.type() == template.type(); + return super.tryBulkMerge(docValues) && docValues.getType() == template.getType(); } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/PackedIntValues.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/PackedIntValues.java index 322495d73c3..ffa46d799bf 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/PackedIntValues.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/PackedIntValues.java @@ -210,7 +210,7 @@ class PackedIntValues { @Override - public Type type() { + public Type getType() { return Type.VAR_INTS; } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarDerefBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarDerefBytesImpl.java index 4fb8deda519..43bff795af4 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarDerefBytesImpl.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarDerefBytesImpl.java @@ -105,7 +105,7 @@ class VarDerefBytesImpl { @Override public Source getDirectSource() throws IOException { - return new DirectVarDerefSource(cloneData(), cloneIndex(), type()); + return new DirectVarDerefSource(cloneData(), cloneIndex(), getType()); } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarSortedBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarSortedBytesImpl.java index cff1f461c91..9a8e87dcaf6 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarSortedBytesImpl.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarSortedBytesImpl.java @@ -166,7 +166,7 @@ final class VarSortedBytesImpl { @Override public Source getDirectSource() throws IOException { - return new DirectSortedSource(cloneData(), cloneIndex(), comparator, type()); + return new DirectSortedSource(cloneData(), cloneIndex(), comparator, getType()); } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarStraightBytesImpl.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarStraightBytesImpl.java index 5b5a43e7f61..cfb9d78cfb6 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarStraightBytesImpl.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene40/values/VarStraightBytesImpl.java @@ -248,7 +248,7 @@ class VarStraightBytesImpl { @Override public Source getDirectSource() throws IOException { - return new DirectVarStraightSource(cloneData(), cloneIndex(), type()); + return new DirectVarStraightSource(cloneData(), cloneIndex(), getType()); } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocProducer.java b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocProducer.java index 88f91c3b71b..59e49c615a4 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocProducer.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/simpletext/SimpleTextPerDocProducer.java @@ -200,7 +200,7 @@ public class SimpleTextPerDocProducer extends PerDocProducerBase { } @Override - public Type type() { + public Type getType() { return type; } diff --git a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java index 0a67716d80d..0aa837fb75d 100644 --- a/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java +++ b/lucene/core/src/java/org/apache/lucene/index/CheckIndex.java @@ -1167,7 +1167,7 @@ public class CheckIndex { if (docValues == null) { throw new RuntimeException("field: " + fieldName + " omits docvalues but should have them!"); } - DocValues.Type type = docValues.type(); + DocValues.Type type = docValues.getType(); if (type != expectedType) { throw new RuntimeException("field: " + fieldName + " has type: " + type + " but fieldInfos says:" + expectedType); } diff --git a/lucene/core/src/java/org/apache/lucene/index/DocValues.java b/lucene/core/src/java/org/apache/lucene/index/DocValues.java index 23999f49e0c..7d77326012d 100644 --- a/lucene/core/src/java/org/apache/lucene/index/DocValues.java +++ b/lucene/core/src/java/org/apache/lucene/index/DocValues.java @@ -90,7 +90,7 @@ public abstract class DocValues implements Closeable { /** * Returns the {@link Type} of this {@link DocValues} instance */ - public abstract Type type(); + public abstract Type getType(); /** * Closes this {@link DocValues} instance. This method should only be called @@ -191,7 +191,7 @@ public abstract class DocValues implements Closeable { * * @return the {@link Type} of this source. */ - public Type type() { + public Type getType() { return type; } diff --git a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java index 0e41f8dceef..75a61cfa5db 100644 --- a/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java +++ b/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java @@ -144,7 +144,7 @@ public class MultiDocValues extends DocValues { } final DocValues d = puller.pull(r, field); if (d != null) { - TypePromoter incoming = TypePromoter.create(d.type(), d.getValueSize()); + TypePromoter incoming = TypePromoter.create(d.getType(), d.getValueSize()); promotedType[0] = promotedType[0].promote(incoming); } else if (puller.stopLoadingOnNull(r, field)){ promotedType[0] = TypePromoter.getIdentityPromoter(); // set to identity to return null @@ -203,8 +203,8 @@ public class MultiDocValues extends DocValues { } @Override - public Type type() { - return emptySource.type(); + public Type getType() { + return emptySource.getType(); } @Override @@ -230,8 +230,8 @@ public class MultiDocValues extends DocValues { } @Override - public Type type() { - return emptyFixedSource.type(); + public Type getType() { + return emptyFixedSource.getType(); } @Override @@ -519,7 +519,7 @@ public class MultiDocValues extends DocValues { @Override public SortedSource asSortedSource() { - if (type() == Type.BYTES_FIXED_SORTED || type() == Type.BYTES_VAR_SORTED) { + if (getType() == Type.BYTES_FIXED_SORTED || getType() == Type.BYTES_VAR_SORTED) { } return super.asSortedSource(); @@ -586,7 +586,7 @@ public class MultiDocValues extends DocValues { } @Override - public Type type() { + public Type getType() { return type; } diff --git a/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java b/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java index 5ac217be72f..316ade37198 100644 --- a/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java +++ b/lucene/core/src/java/org/apache/lucene/index/SegmentMerger.java @@ -173,7 +173,7 @@ final class SegmentMerger { // returns an updated typepromoter (tracking type and size) given a previous one, // and a newly encountered docvalues private TypePromoter mergeDocValuesType(TypePromoter previous, DocValues docValues) { - TypePromoter incoming = TypePromoter.create(docValues.type(), docValues.getValueSize()); + TypePromoter incoming = TypePromoter.create(docValues.getType(), docValues.getValueSize()); if (previous == null) { previous = TypePromoter.getIdentityPromoter(); } diff --git a/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java b/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java index a6860018a5b..5013f2f67d6 100644 --- a/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java +++ b/lucene/core/src/java/org/apache/lucene/search/FieldComparator.java @@ -1640,7 +1640,7 @@ public abstract class FieldComparator { // This means segment has doc values, but they are // not able to provide a sorted source; consider // this a hard error: - throw new IllegalStateException("DocValues exist for field \"" + field + "\", but not as a sorted source: type=" + dv.getSource().type() + " reader=" + context.reader()); + throw new IllegalStateException("DocValues exist for field \"" + field + "\", but not as a sorted source: type=" + dv.getSource().getType() + " reader=" + context.reader()); } } diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene40/values/TestDocValues.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene40/values/TestDocValues.java index 354a70e83fa..e6cff5ba2f8 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene40/values/TestDocValues.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene40/values/TestDocValues.java @@ -188,7 +188,7 @@ public class TestDocValues extends LuceneTestCase { DocValues r = Ints.getValues(dir, "test", 2, Type.VAR_INTS, newIOContext(random)); Source source = getSource(r); assertEquals(i + " with min: " + minMax[i][0] + " max: " + minMax[i][1], - expectedTypes[i], source.type()); + expectedTypes[i], source.getType()); assertEquals(minMax[i][0], source.getInt(0)); assertEquals(minMax[i][1], source.getInt(1)); @@ -368,7 +368,7 @@ public class TestDocValues extends LuceneTestCase { DocValues r = Ints.getValues(dir, "test", NUM_VALUES + additionalDocs, type, newIOContext(random)); for (int iter = 0; iter < 2; iter++) { Source s = getSource(r); - assertEquals(type, s.type()); + assertEquals(type, s.getType()); for (int i = 0; i < NUM_VALUES; i++) { final long v = s.getInt(i); assertEquals("index " + i, values[i], v); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java b/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java index 936bdf05498..a8a4fc3239a 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestCustomNorms.java @@ -83,7 +83,7 @@ public class TestCustomNorms extends LuceneTestCase { assertNotNull(normValues); Source source = normValues.getSource(); assertTrue(source.hasArray()); - assertEquals(Type.FLOAT_32, normValues.type()); + assertEquals(Type.FLOAT_32, normValues.getType()); float[] norms = (float[]) source.getArray(); for (int i = 0; i < open.maxDoc(); i++) { Document document = open.document(i); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java index 1f86bd8ac47..2677190a42e 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDocValuesIndexing.java @@ -432,7 +432,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { if (val == Type.VAR_INTS) { } Source source = docValues.getSource(); - switch (source.type()) { + switch (source.getType()) { case FIXED_INTS_8: { assertTrue(source.hasArray()); @@ -492,7 +492,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { } break; default: - fail("unexpected value " + source.type()); + fail("unexpected value " + source.getType()); } r.close(); } @@ -515,7 +515,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { // getArray() Source source = docValues.getSource(); - switch (source.type()) { + switch (source.getType()) { case BYTES_FIXED_STRAIGHT: { BytesRef ref = new BytesRef(); if (source.hasArray()) { @@ -529,7 +529,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { } break; default: - fail("unexpected value " + source.type()); + fail("unexpected value " + source.getType()); } r.close(); w.close(); @@ -549,7 +549,7 @@ public class TestDocValuesIndexing extends LuceneTestCase { case 2: return values.getDirectSource(); case 1: - if(values.type() == Type.BYTES_VAR_SORTED || values.type() == Type.BYTES_FIXED_SORTED) { + if(values.getType() == Type.BYTES_VAR_SORTED || values.getType() == Type.BYTES_FIXED_SORTED) { return values.getSource().asSortedSource(); } default: diff --git a/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecs.java b/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecs.java index 2c297278c4a..7c416ca2f0d 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecs.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestDuelingCodecs.java @@ -562,7 +562,7 @@ public class TestDuelingCodecs extends LuceneTestCase { public void assertDocValues(DocValues leftDocValues, DocValues rightDocValues) throws Exception { assertNotNull(info, leftDocValues); assertNotNull(info, rightDocValues); - assertEquals(info, leftDocValues.type(), rightDocValues.type()); + assertEquals(info, leftDocValues.getType(), rightDocValues.getType()); assertEquals(info, leftDocValues.getValueSize(), rightDocValues.getValueSize()); assertDocValuesSource(leftDocValues.getDirectSource(), rightDocValues.getDirectSource()); assertDocValuesSource(leftDocValues.getSource(), rightDocValues.getSource()); @@ -572,8 +572,8 @@ public class TestDuelingCodecs extends LuceneTestCase { * checks source API */ public void assertDocValuesSource(DocValues.Source left, DocValues.Source right) throws Exception { - DocValues.Type leftType = left.type(); - assertEquals(info, leftType, right.type()); + DocValues.Type leftType = left.getType(); + assertEquals(info, leftType, right.getType()); switch(leftType) { case VAR_INTS: case FIXED_INTS_8: diff --git a/lucene/core/src/test/org/apache/lucene/index/TestNorms.java b/lucene/core/src/test/org/apache/lucene/index/TestNorms.java index d1d21ed86bb..eff3061085a 100755 --- a/lucene/core/src/test/org/apache/lucene/index/TestNorms.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestNorms.java @@ -96,7 +96,7 @@ public class TestNorms extends LuceneTestCase { assertNotNull(normValues); Source source = normValues.getSource(); assertTrue(source.hasArray()); - assertEquals(Type.FIXED_INTS_8, normValues.type()); + assertEquals(Type.FIXED_INTS_8, normValues.getType()); byte[] norms = (byte[]) source.getArray(); for (int i = 0; i < open.maxDoc(); i++) { Document document = open.document(i); @@ -155,7 +155,7 @@ public class TestNorms extends LuceneTestCase { assertNotNull(normValues); Source source = normValues.getSource(); assertTrue(source.hasArray()); - assertEquals(Type.FIXED_INTS_8, normValues.type()); + assertEquals(Type.FIXED_INTS_8, normValues.getType()); byte[] norms = (byte[]) source.getArray(); for (int i = 0; i < mergedReader.maxDoc(); i++) { Document document = mergedReader.document(i); diff --git a/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java b/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java index 6594a951332..d26b6d038a8 100644 --- a/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java +++ b/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java @@ -349,7 +349,7 @@ public class TestTypePromotion extends LuceneTestCase { DocValues docValues = children[0].reader().docValues("promote"); assertNotNull(docValues); assertValues(TestType.Byte, dir, values); - assertEquals(Type.BYTES_VAR_STRAIGHT, docValues.type()); + assertEquals(Type.BYTES_VAR_STRAIGHT, docValues.getType()); reader.close(); dir.close(); } diff --git a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java index 2bf8b318ec3..aa17061edb8 100644 --- a/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java +++ b/modules/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java @@ -45,7 +45,7 @@ public class NumericIndexDocValueSource extends ValueSource { public FunctionValues getValues(Map context, AtomicReaderContext readerContext) throws IOException { final Source source = readerContext.reader().docValues(field) .getSource(); - Type type = source.type(); + Type type = source.getType(); switch (type) { case FLOAT_32: case FLOAT_64: