Apache Lucene open-source search software
Cleanup StandardGeoPath to get rid of unused member arrays
Karl David Wright5d341e9d8c4f
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.javaindex c761b7453b2..4d711a1efa3 100755--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java@@ -44,10 +44,6 @@ class GeoStandardPath extends GeoBasePath {/** The original list of path points */protected final List<GeoPoint> points = new ArrayList<GeoPoint>();- /** A list of SegmentEndpoints */- protected List<SegmentEndpoint> endPoints;- /** A list of PathSegments */- protected List<PathSegment> segments;/** The b-tree of PathComponents */protected PathComponent rootComponent;@@ -110,8 +106,9 @@ class GeoStandardPath extends GeoBasePath {}isDone = true;- endPoints = new ArrayList<>(points.size());- segments = new ArrayList<>(points.size());+ final List<SegmentEndpoint> endPoints = new ArrayList<>(points.size());+ final List<PathSegment> segments = new ArrayList<>(points.size());+// Compute an offset to use for all segments. This will be based on the minimum magnitude of// the entire ellipsoid.final double cutoffOffset = this.sinAngle * planetModel.getMinimumMagnitude();@@ -179,7 +176,6 @@ class GeoStandardPath extends GeoBasePath {final GeoPoint point = points.get(0);// Construct normal plane- // TBD - what does this actually do? Why Z??final Plane normalPlane = Plane.constructNormalizedZPlane(upperPoint, lowerPoint, point);final CircleSegmentEndpoint onlyEndpoint =@@ -213,29 +209,8 @@ class GeoStandardPath extends GeoBasePath {// General intersection case.// The CutoffDualCircleSegmentEndpoint is advanced enough now to handle// joinings that are perfectly in a line, I believe, so I am disabling- // the special code for that situation. TBD (and testing) to remove it.+ // the special code for that situation.final PathSegment prevSegment = segments.get(i - 1);- /*- if (prevSegment.endCutoffPlane.isWithin(currentSegment.ULHC)- && prevSegment.endCutoffPlane.isWithin(currentSegment.LLHC)- && currentSegment.startCutoffPlane.isWithin(prevSegment.URHC)- && currentSegment.startCutoffPlane.isWithin(prevSegment.LRHC)) {- // The planes are identical. We wouldn't need a circle at all except for the possibility- // of- // backing up, which is hard to detect here.- final SegmentEndpoint midEndpoint =- new CutoffSingleCircleSegmentEndpoint(- planetModel,- prevSegment,- currentSegment.start,- prevSegment.endCutoffPlane,- currentSegment.startCutoffPlane,- currentSegment.ULHC,- currentSegment.LLHC);- // don't need a circle at all. Special constructor...- endPoints.add(midEndpoint);- } else {- */endPoints.add(new CutoffDualCircleSegmentEndpoint(planetModel,@@ -247,7 +222,6 @@ class GeoStandardPath extends GeoBasePath {prevSegment.LRHC,currentSegment.ULHC,currentSegment.LLHC));- // }}// Do final endpointfinal PathSegment lastSegment = segments.get(segments.size() - 1);diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestSimpleGeoPolygonRelationships.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestSimpleGeoPolygonRelationships.javaindex 1a832e358a7..32ee5cea169 100644--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestSimpleGeoPolygonRelationships.java+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/TestSimpleGeoPolygonRelationships.java@@ -803,6 +803,7 @@ public class TestSimpleGeoPolygonRelationships extends LuceneTestCase {GeoPoint[] pointPath1 = new GeoPoint[] {point1, point2};GeoPath path1 = GeoPathFactory.makeGeoPath(PlanetModel.SPHERE, 0, pointPath1);GeoPath path2 = GeoPathFactory.makeGeoPath(PlanetModel.SPHERE, 1, pointPath1);+ System.out.println("path1 = " + path1 + " path2 = " + path2);int rel = path1.getRelationship(path2);// if an end point is inside the shape it will always return intersectsassertEquals(GeoArea.CONTAINS, rel); // should be contains?