-
Notifications
You must be signed in to change notification settings - Fork 120
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
expose snapping_include_static_closures #1469
Conversation
60cbc03
to
29f3cbe
Compare
@@ -0,0 +1,122 @@ | |||
{ |
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.
how is this file used? Can't find any usages 🤔
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.
Whoops.
29f3cbe
to
375020f
Compare
Codecov Report
@@ Coverage Diff @@
## main #1469 +/- ##
============================================
+ Coverage 75.68% 76.38% +0.70%
- Complexity 881 896 +15
============================================
Files 125 125
Lines 3907 3905 -2
Branches 578 568 -10
============================================
+ Hits 2957 2983 +26
+ Misses 687 675 -12
+ Partials 263 247 -16
|
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.
LGTM 👍
Please check the comment if you get a chance
@NonNull | ||
public Builder snappingIncludeStaticClosuresList( | ||
@Nullable List<Boolean> snappingStaticClosures | ||
) { | ||
String result = FormatUtils.join(";", snappingStaticClosures); | ||
if (result != null) { | ||
snappingIncludeStaticClosures(result); | ||
} | ||
return this; | ||
} |
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.
What does happen if you reset parameters from existing route options?
RouteOptions.builder().
.build()
// all all required parameters
.snappingIncludeStaticClosuresList(listOf(true, false))
.toBuilder()
.snappingIncludeStaticClosuresList(null)
.build()
or
RouteOptions.builder().
.build()
// all all required parameters
.snappingIncludeStaticClosuresList(listOf(true, false))
.toBuilder()
.snappingIncludeStaticClosuresList(emptyList())
.build()
?
Do you think it makes sense to add tests for this?
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.
I added tests for null and empty list but without previous toBuilder
invocation. I also added tests that nothing breaks after toBuilder
+ build
(is this redundant?). I'm not sure tho why it would make sense to check resetting.
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.
resetting from a value to null looks suspicious in the code. It seems that in case of null
snappingIncludeStaticClosures
won't be called from snappingIncludeStaticClosuresList
and state won't change. As I see, coordinates work in the same way, so I'm not sure it's a bug. I think it would be nice to document that behaviour in the test. WDYT?
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.
Great catch! I'd say it's a bug. @LukasPaczos added this code, WDYT?
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.
That does look like a bug.
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.
LGTM with 1 test request
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/RouteOptions.java
Show resolved
Hide resolved
375020f
to
a44de32
Compare
Should this feature receive the same treatment as |
I believe so, yes. @nuttert can you confirm? |
Tracking in mapbox/mapbox-navigation-android#6119. |
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.
LGTM
No description provided.