Skip to content

Apache Lucene open-source search software

LUCENE-10508: Use MIN_WIDE_EXTENT for all wide rectangles (#845)

Ignacio Vera922d3af8d67e
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideLongitudeSlice.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideLongitudeSlice.java
index 3e9b0b758d0..4089b8ffe14 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideLongitudeSlice.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideLongitudeSlice.java
@@ -67,7 +67,7 @@ class GeoWideLongitudeSlice extends GeoBaseBBox {
if (extent < 0.0) {
extent += 2.0 * Math.PI;
}
- if (extent < Math.PI) {
+ if (extent < GeoWideRectangle.MIN_WIDE_EXTENT) {
throw new IllegalArgumentException("Width of rectangle too small");
}
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideNorthRectangle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideNorthRectangle.java
index 8fefca336ed..8f99b06fcc1 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideNorthRectangle.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideNorthRectangle.java
@@ -93,7 +93,7 @@ class GeoWideNorthRectangle extends GeoBaseBBox {
if (extent < 0.0) {
extent += 2.0 * Math.PI;
}
- if (extent < Math.PI) {
+ if (extent < GeoWideRectangle.MIN_WIDE_EXTENT) {
throw new IllegalArgumentException("Width of rectangle too small");
}
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideSouthRectangle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideSouthRectangle.java
index 5320e2221fb..7ccc258697d 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideSouthRectangle.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoWideSouthRectangle.java
@@ -87,7 +87,7 @@ class GeoWideSouthRectangle extends GeoBaseBBox {
if (extent < 0.0) {
extent += 2.0 * Math.PI;
}
- if (extent < Math.PI) {
+ if (extent < GeoWideRectangle.MIN_WIDE_EXTENT) {
throw new IllegalArgumentException("Width of rectangle too small");
}