Re: 8143850: retrofit ArrayDeque to implement List

2018-08-07 Thread Roger Riggs
Hi, Compare with sun.awt.util.IdentityLinkedList.java; not likely to be exactly what you are looking for but it is an implementation with similar features. $.02, Roger On 8/4/18 4:11 AM, Peter Levart wrote: Hi all, On 08/04/2018 01:51 AM, Stuart Marks wrote: Thanks, Patrick! This is very

Re: 8143850: retrofit ArrayDeque to implement List

2018-08-04 Thread Peter Levart
Hi all, On 08/04/2018 01:51 AM, Stuart Marks wrote: Thanks, Patrick! This is very helpful. Alex, others, (Meta: I've been at JVMLS and the OpenJDK Committers' Workshop all week, and I'm on vacation next week, so I don't have much time to discuss this right now. However, I am interested in

Re: 8143850: retrofit ArrayDeque to implement List

2018-08-03 Thread Stuart Marks
Thanks, Patrick! This is very helpful. Alex, others, (Meta: I've been at JVMLS and the OpenJDK Committers' Workshop all week, and I'm on vacation next week, so I don't have much time to discuss this right now. However, I am interested in moving this forward.) OK, so the API in this webrev

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-31 Thread Patrick Reinhart
Am 31.07.2018 um 21:10 schrieb Patrick Reinhart: > Hi Alex, > > I can do that for you > > -Patrick > Here it is: http://cr.openjdk.java.net/~reinhapa/reviews/8143850/webrev -Patrick

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-31 Thread Patrick Reinhart
t Marks > Sent: July 31, 2018 2:40 PM > To: Alex Foster > Cc: core-libs-dev@openjdk.java.net > Subject: Re: 8143850: retrofit ArrayDeque to implement List > > > OK, great. > > > It looks like a heavily modified version of ArrayDeque.java. This makes it a > bit dif

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-31 Thread Alex Foster
-libs-dev@openjdk.java.net> Subject: Re: 8143850: retrofit ArrayDeque to implement List Hi, I finally got some time to get my head around this. Conceptually, I like the idea of a List that's stored in a circular array, like ArrayDeque. The best way to manifest this in the API isn't obvious tho

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-31 Thread Stuart Marks
e-libs-dev@openjdk.java.net *Subject:* Re: 8143850: retrofit ArrayDeque to implement List Hi, I finally got some time to get my head around this. Conceptually, I like the idea of a List that's stored in a circular array, like ArrayDeque. The best way to manifest this in the API isn't obvious tho

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-29 Thread Alex Foster
Hi, Here's my current proposal: https://pastebin.com/EABgwLYS Alex From: Stuart Marks Sent: July 28, 2018 8:11 PM To: Martin Buchholz; Alex Foster Cc: Doug Lea; core-libs-dev@openjdk.java.net Subject: Re: 8143850: retrofit ArrayDeque to implement List Hi, I

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-28 Thread Stuart Marks
Hi, I finally got some time to get my head around this. Conceptually, I like the idea of a List that's stored in a circular array, like ArrayDeque. The best way to manifest this in the API isn't obvious though. I filed the bug as "retrofit ArrayDeque to implement List" but of course it

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-23 Thread Martin Buchholz
(As usual, I don't have enough time to devote to this at the moment) I sort of like the idea of adding all of those List methods to ArrayDeque, but it's __weird__ for java code to do that, and remove(int) is a problem when you have ArrayDeque, so it will probably end up rejected. --- Similarly,

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-17 Thread Alex Foster
Hi again, I updated ArrayDeque with your last idea (adding all list methods but not implementing List) and added a subclass ArrayDeque.List which overrides equals and hashcode and implements List. There is also a subclass ArrayDeque.WithNulls that accepts null elements. ArrayDeque has

Re: 8143850: retrofit ArrayDeque to implement List

2018-07-02 Thread Alex Foster
Another question is whether or not it should allow null elements. ArrayDeque currently doesn't but I think it would be useful to support them, which makes having an asList() view or sharing code harder.

Re: 8143850: retrofit ArrayDeque to implement List

2018-06-29 Thread Martin Buchholz
On Thu, Jun 28, 2018 at 11:42 PM, Alex Foster wrote: > Another question is whether or not it should allow null elements. > ArrayDeque currently doesn't but I think it would be useful to support > them, which makes having an asList() view or sharing code harder. > JDK has moved away from null

Re: 8143850: retrofit ArrayDeque to implement List

2018-06-28 Thread Martin Buchholz
Thanks, Alex. This has been on my todo list for a long time and I'm more overcommitted than ever. The difficult part is designing of the interface, but then there are many tests to write... I sort of liked ArrayDeque.asList() because at least then the API surface to be added is small.