From ee0e9216435ad73d91207b6ae5a3870ad9e139e7 Mon Sep 17 00:00:00 2001 From: Eli Skeggs Date: Thu, 8 Jun 2017 08:23:22 -0700 Subject: [PATCH] Fix typo in GeoUtils#isValidLongitude (#25121) GeoUtils#isValidLongitude is inconsistent with GeoUtils#isValidLatitude. Neither technically need the isInfinite() check because they then compare against min and max values. --- core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java b/core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java index a5864146318..aed72f502bf 100644 --- a/core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java +++ b/core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java @@ -82,7 +82,7 @@ public class GeoUtils { /** Returns true if longitude is actually a valid longitude value. */ public static boolean isValidLongitude(double longitude) { - if (Double.isNaN(longitude) || Double.isNaN(longitude) || longitude < GeoUtils.MIN_LON || longitude > GeoUtils.MAX_LON) { + if (Double.isNaN(longitude) || Double.isInfinite(longitude) || longitude < GeoUtils.MIN_LON || longitude > GeoUtils.MAX_LON) { return false; } return true;