You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2020/02/26 14:36:24 UTC
[lucene-solr] branch branch_8x updated: LUCENE-9252: fix javac
linter warnings in spatial-extras (thanks Andras Salamon)
This is an automated email from the ASF dual-hosted git repository.
mikemccand pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_8x by this push:
new 570109f LUCENE-9252: fix javac linter warnings in spatial-extras (thanks Andras Salamon)
570109f is described below
commit 570109f73de4ef8521e76339878534282196afed
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Wed Feb 26 09:34:58 2020 -0500
LUCENE-9252: fix javac linter warnings in spatial-extras (thanks Andras Salamon)
---
.../java/org/apache/lucene/spatial/spatial4j/Geo3dBinaryCodec.java | 5 +++--
.../spatial/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 650e561..6754e74 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 bf152b7..fb4f678 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<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