LUCENE-9252: fix javac linter warnings in spatial-extras (thanks Andras Salamon)

This commit is contained in:
Mike McCandless 2020-02-26 09:34:58 -05:00
parent d91f7856ba
commit 570109f73d
2 changed files with 4 additions and 3 deletions

View File

@ -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();
}

View File

@ -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<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