#19251 closed task (fixed)
Java 8: use Stream
Reported by: | simon04 | Owned by: | simon04 |
---|---|---|---|
Priority: | normal | Milestone: | 20.05 |
Component: | Core | Version: | |
Keywords: | java refactoring stream | Cc: |
Description
Attachments (0)
Change History (18)
comment:1 Changed 3 years ago by
comment:4 Changed 3 years ago by
Are you sure that this doesn't cause an endless loop when relation contains itself or when we have more complex loops like
a -> b, b-> c; c->a ?
nearestList.stream() .flatMap(o -> o.getReferrers().stream()) .filter(r -> r instanceof Relation && predicate.test(r)) .forEach(nearestList::add);
NavigatableComponent line 1610ff
comment:9 Changed 3 years ago by
Replying to GerdP:
Are you sure that this doesn't cause an endless loop when relation contains itself or when we have more complex loops like
a -> b, b-> c; c->a ?
No, thanks for spotting the error! Inlining the variable parentRelations
was faulty. I addressed this in r16444.
Edit: This error also has been reported by Java: https://josm.openstreetmap.de/jenkins/job/JOSM/6422/warnings9Result/module.1732282867/package.-515814635/
comment:11 Changed 3 years ago by
And I thought you were studiously reading through the lengthy diff. ;-)
comment:16 Changed 3 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In 16436/josm: