You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kw...@apache.org on 2022/11/25 09:54:45 UTC

[lucene] branch branch_9x updated: Add back BOTH the method I introduced AND the call to it. Both were removed by independent fixers looking at already-addressed failures. Hopefully by getting gradlew check to pass TWICE it won't happen again.

This is an automated email from the ASF dual-hosted git repository.

kwright pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new b0b15089ece Add back BOTH the method I introduced AND the call to it. Both were removed by independent fixers looking at already-addressed failures.  Hopefully by getting gradlew check to pass TWICE it won't happen again.
b0b15089ece is described below

commit b0b15089ece4d62b2e9bff88d4191e7370ace8ac
Author: Karl David Wright <kw...@apache.org>
AuthorDate: Fri Nov 25 04:52:03 2022 -0500

    Add back BOTH the method I introduced AND the call to it. Both were removed by independent fixers looking at already-addressed failures.  Hopefully by getting gradlew check to pass TWICE it won't happen again.
---
 .../lucene/spatial3d/geom/GeoDegeneratePath.java   | 23 ++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePath.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePath.java
index bba5a016c16..9027e172821 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePath.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePath.java
@@ -468,6 +468,23 @@ class GeoDegeneratePath extends GeoBasePath {
       return this.point.isIdentical(x, y, z);
     }
 
+    /**
+     * Check if point is within this section's purview.
+     *
+     * @param x is the point x
+     * @param y is the point y
+     * @param z is the point z
+     * @return true if this point "belongs" to this section, falso otherwise.
+     */
+    public boolean isWithinSection(final double x, final double y, final double z) {
+      for (final Membership m : cutoffPlanes) {
+        if (!m.isWithin(x, y, z)) {
+          return false;
+        }
+      }
+      return true;
+    }
+
     /**
      * Compute interior path distance.
      *
@@ -497,10 +514,8 @@ class GeoDegeneratePath extends GeoBasePath {
      */
     public double pathCenterDistance(
         final DistanceStyle distanceStyle, final double x, final double y, final double z) {
-      for (final Membership m : cutoffPlanes) {
-        if (!m.isWithin(x, y, z)) {
-          return Double.POSITIVE_INFINITY;
-        }
+      if (!isWithinSection(x, y, z)) {
+        return Double.POSITIVE_INFINITY;
       }
       return distanceStyle.toAggregationForm(distanceStyle.computeDistance(this.point, x, y, z));
     }