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

[lucene-solr] 15/38: LUCENE-9641: Fix LatLonShape#testPointIndexAndQuery test bug.

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

ctargett pushed a commit to branch jira/solr-13105-toMerge
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit ce3d7a16fd0e8590210de5a6173dc89fcec218b8
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 a916602..9f828f6 100644
--- a/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java
+++ b/lucene/core/src/test/org/apache/lucene/document/TestLatLonShape.java
@@ -456,14 +456,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) {