Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

LatLngBounds.from() validation #10730

Closed
osana opened this issue Dec 18, 2017 · 1 comment · Fixed by #10831
Closed

LatLngBounds.from() validation #10730

osana opened this issue Dec 18, 2017 · 1 comment · Fixed by #10831
Assignees
Labels
Android Mapbox Maps SDK for Android

Comments

@osana
Copy link
Contributor

osana commented Dec 18, 2017

LatLngBounds(double, double, double,double) constructor does not validate its parameters.

should northLatitude >= southLatitude and eastLongitude >= westLongitude?
Should we through and IAE?

Should we compare agains GeoConstants Max, Min values?
Should use the Max, Min or throw IAE if that is not the case?

If values are passed in as wrapped? Do change into non-wrapped or do we min/max?

@osana osana added the Android Mapbox Maps SDK for Android label Dec 18, 2017
@osana osana self-assigned this Dec 18, 2017
@osana osana changed the title LatLngBounds constructor validation LatLngBounds.from() validation Jan 4, 2018
@osana
Copy link
Contributor Author

osana commented Jan 4, 2018

LatLngBounds constructor is package private. It is used by LatLngBounds.Builder() and by LatLngBounds.from() method. Builder does parameter validation while LatLngBounds.from() does not.

The same parameter validation should be added as is done in the Builder via LatLng() constructor. See LatLng's setLatitude() and setLongitude() methods.
New tests should be added to LatLngBoundsTest as are done in LatLngTest - see Constructor tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant