You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The scenario is the following: We have a list of GPS points of which some or all are invalid which is denoted by the coordinates being (0 , 0) - which IS bad Design, but our Team cannot change this... 🙄. Thus, we filter out those points before passing it to the length method. We just encountered an IndexOutOfBoundsException when the list is empty because there is no length check on the list. I guess the fix here is relatively easy, but the question ist - what should be returned in this case. We built in a check before hand returning 0 in this particular case. Maybe even a checked exception might be a feasible idea.
The text was updated successfully, but these errors were encountered:
The other day, I encountered what I regard as an issue in the following Code snippet:
mapbox-java/services-turf/src/main/java/com/mapbox/turf/TurfMeasurement.java
Line 227 in 4ae8b78
The scenario is the following: We have a list of GPS points of which some or all are invalid which is denoted by the coordinates being (0 , 0) - which IS bad Design, but our Team cannot change this... 🙄. Thus, we filter out those points before passing it to the
length
method. We just encountered an IndexOutOfBoundsException when the list is empty because there is no length check on the list. I guess the fix here is relatively easy, but the question ist - what should be returned in this case. We built in a check before hand returning 0 in this particular case. Maybe even a checked exception might be a feasible idea.The text was updated successfully, but these errors were encountered: