diff --git a/server/src/main/java/org/elasticsearch/common/geo/BoundingBox.java b/server/src/main/java/org/elasticsearch/common/geo/BoundingBox.java index 3eea2370fd59e..b452659b0ac5d 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/BoundingBox.java +++ b/server/src/main/java/org/elasticsearch/common/geo/BoundingBox.java @@ -86,7 +86,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws public abstract XContentBuilder toXContentFragment(XContentBuilder builder, boolean buildLatLonFields) throws IOException; - protected abstract static class BoundsParser { + protected abstract static class BoundsParser> { protected double top = Double.NaN; protected double bottom = Double.NaN; protected double left = Double.NaN; @@ -98,7 +98,7 @@ protected BoundsParser(XContentParser parser) { this.parser = parser; } - public BoundingBox parseBoundingBox() throws IOException, ElasticsearchParseException { + public T parseBoundingBox() throws IOException, ElasticsearchParseException { XContentParser.Token token = parser.currentToken(); if (token != XContentParser.Token.START_OBJECT) { throw new ElasticsearchParseException("failed to parse bounding box. Expected start object but found [{}]", token); @@ -172,9 +172,9 @@ public BoundingBox parseBoundingBox() throws IOException, ElasticsearchParseE return createWithBounds(); } - protected abstract BoundingBox createWithEnvelope(); + protected abstract T createWithEnvelope(); - protected abstract BoundingBox createWithBounds(); + protected abstract T createWithBounds(); protected abstract SpatialPoint parsePointWith(XContentParser parser, GeoUtils.EffectivePoint effectivePoint) throws IOException; } diff --git a/server/src/main/java/org/elasticsearch/common/geo/GeoBoundingBox.java b/server/src/main/java/org/elasticsearch/common/geo/GeoBoundingBox.java index 52d87a63dded0..8fbd0d6d11ee6 100644 --- a/server/src/main/java/org/elasticsearch/common/geo/GeoBoundingBox.java +++ b/server/src/main/java/org/elasticsearch/common/geo/GeoBoundingBox.java @@ -86,7 +86,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeGeoPoint(bottomRight); } - protected static class GeoBoundsParser extends BoundsParser { + protected static class GeoBoundsParser extends BoundsParser { GeoBoundsParser(XContentParser parser) { super(parser); } @@ -116,6 +116,6 @@ protected SpatialPoint parsePointWith(XContentParser parser, GeoUtils.EffectiveP */ public static GeoBoundingBox parseBoundingBox(XContentParser parser) throws IOException, ElasticsearchParseException { GeoBoundsParser bounds = new GeoBoundsParser(parser); - return (GeoBoundingBox) bounds.parseBoundingBox(); + return bounds.parseBoundingBox(); } } diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/IndexPointFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/IndexPointFieldData.java index 84caedf3a13f3..7373e01c71c0b 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/IndexPointFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/IndexPointFieldData.java @@ -8,7 +8,9 @@ package org.elasticsearch.index.fielddata; +import org.elasticsearch.common.geo.SpatialPoint; + /** * Specialization of {@link IndexFieldData} for geo points and points. */ -public interface IndexPointFieldData> extends IndexFieldData> {} +public interface IndexPointFieldData> extends IndexFieldData> {} diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/LeafPointFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/LeafPointFieldData.java index a8cf6ea03171a..a30664b909d17 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/LeafPointFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/LeafPointFieldData.java @@ -8,11 +8,12 @@ package org.elasticsearch.index.fielddata; import org.apache.lucene.index.SortedNumericDocValues; +import org.elasticsearch.common.geo.SpatialPoint; /** * {@link LeafFieldData} specialization for geo points and points. */ -public abstract class LeafPointFieldData> implements LeafFieldData { +public abstract class LeafPointFieldData> implements LeafFieldData { /** * Return geo-point or point values. diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/plain/AbstractPointIndexFieldData.java b/server/src/main/java/org/elasticsearch/index/fielddata/plain/AbstractPointIndexFieldData.java index e51bf5f2e6349..b1b5c9dc094d2 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/plain/AbstractPointIndexFieldData.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/plain/AbstractPointIndexFieldData.java @@ -8,6 +8,7 @@ package org.elasticsearch.index.fielddata.plain; import org.apache.lucene.search.SortField; +import org.elasticsearch.common.geo.SpatialPoint; import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.core.Nullable; import org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested; @@ -20,7 +21,7 @@ import org.elasticsearch.search.sort.BucketedSort; import org.elasticsearch.search.sort.SortOrder; -abstract class AbstractPointIndexFieldData> implements IndexPointFieldData { +abstract class AbstractPointIndexFieldData> implements IndexPointFieldData { protected final String fieldName; protected final ValuesSourceType valuesSourceType;