De-duplicate stops returned by stopsByRadius#5366
Conversation
stopsByRadiusstopsByRadius
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5366 +/- ##
=============================================
+ Coverage 66.48% 66.49% +0.01%
+ Complexity 15238 15236 -2
=============================================
Files 1787 1786 -1
Lines 69325 69271 -54
Branches 7319 7291 -28
=============================================
- Hits 46088 46064 -24
+ Misses 20758 20739 -19
+ Partials 2479 2468 -11
☔ View full report in Codecov by Sentry. |
binh-dam-ibigroup
left a comment
There was a problem hiding this comment.
The issue mentioned is indeed resolved. Thanks!
630733d to
8d39386
Compare
|
Oracle discourages the use of stateful filters (https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/util/stream/package-summary.html#Statelessness), an alternative implementation could use collectors to achieve the same effect:
In this particular case, the impact is limited, so approving anyway. |
|
That's an excellent point which I will implement in a follow-up PR. |
Summary
@binh-dam-ibigroup has reported that there are cases where the
stopsByRadiusGraphQL query returns duplicate stops. This PR removes the duplicates.It introduces a new Util class that lets you remove duplicates from a collection even when the thing to deduplicate on is not the whole entity but a field of it.
Unit tests
Added.
Documentation
Javadoc.