Skip to content

Commit ee0e921

Browse files
skeggsecbuescher
authored andcommitted
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.
1 parent a0afa91 commit ee0e921

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/elasticsearch/common/geo/GeoUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static boolean isValidLatitude(double latitude) {
8282

8383
/** Returns true if longitude is actually a valid longitude value. */
8484
public static boolean isValidLongitude(double longitude) {
85-
if (Double.isNaN(longitude) || Double.isNaN(longitude) || longitude < GeoUtils.MIN_LON || longitude > GeoUtils.MAX_LON) {
85+
if (Double.isNaN(longitude) || Double.isInfinite(longitude) || longitude < GeoUtils.MIN_LON || longitude > GeoUtils.MAX_LON) {
8686
return false;
8787
}
8888
return true;

0 commit comments

Comments
 (0)