From 570109f73de4ef8521e76339878534282196afed Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Wed, 26 Feb 2020 09:34:58 -0500 Subject: [PATCH] LUCENE-9252: fix javac linter warnings in spatial-extras (thanks Andras Salamon) --- .../apache/lucene/spatial/spatial4j/Geo3dBinaryCodec.java | 5 +++-- .../spatial4j/Geo3dShapeSphereModelRectRelationTest.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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.java index 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 { @Override public 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.java index 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 ShapeRectRelationTest public 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 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