Apache Lucene open-source search software
LUCENE-9252: fix javac linter warnings in spatial-extras (thanks Andras Salamon)
Mike McCandless61e0b4cd87b9
diff --git a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/spatial4j/Geo3dBinaryCodec.java b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/spatial4j/Geo3dBinaryCodec.javaindex 650e5610c9b..6754e746b70 100644--- a/lucene/spatial-extras/src/java/org/apache/lucene/spatial/spatial4j/Geo3dBinaryCodec.java+++ b/lucene/spatial-extras/src/java/org/apache/lucene/spatial/spatial4j/Geo3dBinaryCodec.java@@ -47,7 +47,6 @@ public class Geo3dBinaryCodec extends BinaryCodec {private PlanetModel planetModel;- @SuppressWarnings("unchecked")public Geo3dBinaryCodec(SpatialContext ctx, SpatialContextFactory factory) {super(ctx, factory);planetModel = ((Geo3dSpatialContextFactory) factory).planetModel;@@ -66,7 +65,7 @@ public class Geo3dBinaryCodec extends BinaryCodec {@Overridepublic void writeShape(DataOutput dataOutput, Shape s) throws IOException {if (s instanceof Geo3dShape) {- Geo3dShape geoAreaShape = (Geo3dShape) s;+ Geo3dShape<?> geoAreaShape = (Geo3dShape<?>) s;SerializableObject.writeObject((OutputStream) dataOutput, geoAreaShape.shape);} else {throw new IllegalArgumentException("trying to write a not supported shape: " + s.getClass().getName());@@ -119,11 +118,13 @@ public class Geo3dBinaryCodec extends BinaryCodec {}@Override+ @SuppressWarnings("rawtypes")public ShapeCollection readCollection(DataInput dataInput) throws IOException {throw new UnsupportedOperationException();}@Override+ @SuppressWarnings("rawtypes")public void writeCollection(DataOutput dataOutput, ShapeCollection col) throws IOException {throw new UnsupportedOperationException();}diff --git a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeSphereModelRectRelationTest.java b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeSphereModelRectRelationTest.javaindex bf152b7fdfb..fb4f67890e1 100644--- a/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeSphereModelRectRelationTest.java+++ b/lucene/spatial-extras/src/test/org/apache/lucene/spatial/spatial4j/Geo3dShapeSphereModelRectRelationTest.java@@ -70,7 +70,7 @@ public class Geo3dShapeSphereModelRectRelationTest extends ShapeRectRelationTestpublic void testFailure2_LUCENE6475() {GeoCircle geo3dCircle = GeoCircleFactory.makeGeoCircle(planetModel, 1.6282053147165243E-4 * RADIANS_PER_DEGREE,-70.1600629789353 * RADIANS_PER_DEGREE, 86 * RADIANS_PER_DEGREE);- Geo3dShape geo3dShape = new Geo3dShape(geo3dCircle, ctx);+ Geo3dShape<GeoCircle> geo3dShape = new Geo3dShape<>(geo3dCircle, ctx);Rectangle rect = ctx.makeRectangle(-118, -114, -2.0, 32.0);assertTrue(geo3dShape.relate(rect).intersects());// thus the bounding box must intersect too