Modify

Opened 2 months ago

Closed 2 months ago

#20587 closed defect (fixed)

[PATCH] QuadBuckets `toArray` can infinitely recurse

Reported by: taylor.smock Owned by: Don-vip
Priority: normal Milestone: 21.02
Component: Core Version:
Keywords: Cc:

Description

This behavior is somewhat dependent upon the JVM implementation of ArrayList<>(Collection<T> collection).

However, if the constructor uses toArray to get the initial array for the ArrayList, we have something that looks like this:
toArray -> toList -> toArray -> toList -> toArray -> ...

Attachments (1)

20587.patch (881 bytes) - added by taylor.smock 2 months ago.
Use this.stream().toArray() instead of this.toList().toArray() for the toArray() function, and document why

Download all attachments as: .zip

Change History (3)

Changed 2 months ago by taylor.smock

Attachment: 20587.patch added

Use this.stream().toArray() instead of this.toList().toArray() for the toArray() function, and document why

comment:1 Changed 2 months ago by Don-vip

Milestone: 21.02
Owner: changed from team to Don-vip
Status: newassigned

comment:2 Changed 2 months ago by Don-vip

Resolution: fixed
Status: assignedclosed

In 17559/josm:

fix #20587 - fix potential infinite loop in QuadBuckets toArray (patch by taylor.smock)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.