You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by vo...@apache.org on 2024/01/24 18:23:44 UTC
(lucene) branch branch_9x updated: Fix bug in ShapeTestUtil (#12287)
This is an automated email from the ASF dual-hosted git repository.
voditas 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 1e586c9015c Fix bug in ShapeTestUtil (#12287)
1e586c9015c is described below
commit 1e586c9015c33e50812f367c7bec83ecb957441c
Author: Heemin Kim <he...@amazon.com>
AuthorDate: Wed Jan 24 10:09:37 2024 -0800
Fix bug in ShapeTestUtil (#12287)
boxPolygon and trianglePolygon only uses minX and minY value of give XY Rectangle which results in a polygon with points in single place. With this changes, both methods generate correct polygons.
---
lucene/CHANGES.txt | 2 ++
.../java/org/apache/lucene/tests/geo/ShapeTestUtil.java | 14 +++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 854e6ff769e..ae2518554a1 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -67,6 +67,8 @@ Bug Fixes
* GITHUB#12885: Fixed the bug that JapaneseReadingFormFilter cannot convert some hiragana to romaji. (Takuma Kuramitsu)
+* GITHUB#12287: Fix a bug in ShapeTestUtil. (Heemin Kim)
+
Build
---------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/geo/ShapeTestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/ShapeTestUtil.java
index e0e8c6964fc..aed0a92ea4c 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/tests/geo/ShapeTestUtil.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/tests/geo/ShapeTestUtil.java
@@ -99,10 +99,10 @@ public class ShapeTestUtil {
final float[] polyY = new float[4];
polyX[0] = box.minX;
polyY[0] = box.minY;
- polyX[1] = box.minX;
+ polyX[1] = box.maxX;
polyY[1] = box.minY;
- polyX[2] = box.minX;
- polyY[2] = box.minY;
+ polyX[2] = box.maxX;
+ polyY[2] = box.maxY;
polyX[3] = box.minX;
polyY[3] = box.minY;
return new XYPolygon(polyX, polyY);
@@ -142,12 +142,12 @@ public class ShapeTestUtil {
final float[] polyY = new float[5];
polyX[0] = box.minX;
polyY[0] = box.minY;
- polyX[1] = box.minX;
+ polyX[1] = box.maxX;
polyY[1] = box.minY;
- polyX[2] = box.minX;
- polyY[2] = box.minY;
+ polyX[2] = box.maxX;
+ polyY[2] = box.maxY;
polyX[3] = box.minX;
- polyY[3] = box.minY;
+ polyY[3] = box.maxY;
polyX[4] = box.minX;
polyY[4] = box.minY;
return new XYPolygon(polyX, polyY);