-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix route requests that include waypoint names #1260
Conversation
43075ba
to
870acb6
Compare
Tests added, this is ready for 👀 @Guardiola31337 @devotaaabel |
870acb6
to
7462203
Compare
7462203
to
a6b8342
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this PR is already merged, going to leave a couple of comments for checking in the future.
public String[] calculateRemainingWaypointNames(RouteProgress routeProgress) { | ||
RouteOptions routeOptions = routeProgress.directionsRoute().routeOptions(); | ||
if (routeOptions == null || TextUtils.isEmpty(routeOptions.waypointNames())) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider returning a Null Object instead or even better try to getting rid of it at all (maybe returning an empty list?). If not, code becomes defensive and full of null
checks.
* @since 0.19.0 | ||
*/ | ||
@Nullable | ||
public String[] calculateRemainingWaypointNames(RouteProgress routeProgress) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is only used in RouteFetcher#addWaypointNames
why we need to expose it as a public
API here in RouteUtils
?
IMO, objects and methods should live/be where their context is. From my experience utility classes become a drawer easily and we should treat them carefully.
Fixes #1160
TODO:
RouteUtils
test