You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by iv...@apache.org on 2021/01/08 12:45:39 UTC

[lucene-solr] branch branch_8x updated: LUCENE-9641: Fix LatLonShape#testPointIndexAndQuery test bug.

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

ivera 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 c9d1129  LUCENE-9641: Fix LatLonShape#testPointIndexAndQuery test bug.
c9d1129 is described below

commit c9d1129d4b79e4bac2383edfb8504ccba9e08915
Author: iverase <iv...@apache.org>
AuthorDate: Fri Jan 8 13:43:29 2021 +0100

    LUCENE-9641: Fix LatLonShape#testPointIndexAndQuery test bug.
---
 .../src/test/org/apache/lucene/document/TestLatLonShape.java   | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java
index 0d00a44..44c293f 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java
@@ -425,14 +425,8 @@ public class TestLatLonShape extends LuceneTestCase {
     RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
     Document document = new Document();
     Point p = GeoTestUtil.nextPoint();
-    double qLat =
-        p.getLat() == GeoUtils.MAX_LAT_INCL
-            ? p.getLat()
-            : GeoEncodingUtils.decodeLatitude(GeoEncodingUtils.encodeLatitudeCeil(p.getLat()));
-    double qLon =
-        p.getLon() == GeoUtils.MAX_LON_INCL
-            ? p.getLon()
-            : GeoEncodingUtils.decodeLongitude(GeoEncodingUtils.encodeLongitudeCeil(p.getLon()));
+    double qLat = GeoEncodingUtils.decodeLatitude(GeoEncodingUtils.encodeLatitude(p.getLat()));
+    double qLon = GeoEncodingUtils.decodeLongitude(GeoEncodingUtils.encodeLongitude(p.getLon()));
     p = new Point(qLat, qLon);
     Field[] fields = LatLonShape.createIndexableFields(FIELDNAME, p.getLat(), p.getLon());
     for (Field f : fields) {