Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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 by simon04, 4 years ago

In 16436/josm:

see #19251 - Java 8: use Stream

comment:2 by simon04, 4 years ago

In 16437/josm:

see #19251 - Fix MapListSetting

comment:3 by simon04, 4 years ago

In 16438/josm:

see #19251 - Java 8: use Stream

comment:4 by GerdP, 4 years ago

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

Last edited 4 years ago by GerdP (previous) (diff)

comment:5 by GerdP, 4 years ago

see #19252, probably a regression

comment:6 by simon04, 4 years ago

In 16441/josm:

see #19251 - Checkstyle, PMD

comment:7 by simon04, 4 years ago

In 16444/josm:

see #19251 - Fix NavigatableComponent.getAllNearest

comment:8 by simon04, 4 years ago

In 16445/josm:

see #19251 - Java 8: use Stream

in reply to:  7 comment:9 by simon04, 4 years ago

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/

Last edited 4 years ago by simon04 (previous) (diff)

comment:10 by GerdP, 4 years ago

Yes, that's why I looked at it ;)

comment:11 by simon04, 4 years ago

And I thought you were studiously reading through the lengthy diff. ;-)

comment:12 by simon04, 4 years ago

In 16448/josm:

see #19251 - Java warnings

comment:13 by simon04, 4 years ago

In 16451/josm:

see #19251 - Java warning, FindBugs

comment:14 by simon04, 4 years ago

In 16452/josm:

see #19251 - Java 8: use Stream

comment:15 by simon04, 4 years ago

In 16453/josm:

see #19251, see #19252 - fix findFirst/map/orElse sequence

comment:16 by simon04, 4 years ago

Resolution: fixed
Status: assignedclosed

comment:17 by GerdP, 4 years ago

see #19259 for a regression

comment:18 by GerdP, 4 years ago

see #19055 for a regression

Last edited 4 years ago by GerdP (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.