8143850: retrofit ArrayDeque to implement List

Martin Buchholz martinrb at google.com
Fri Jun 29 04:10:25 UTC 2018


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.

ArrayDeque has changed a little between jdk8 and now.

Almost all the code could be shared with the List-implementing class - we
don't want to introduce (too much) duplication.


On Tue, Jun 26, 2018 at 12:04 PM, Alex Foster <alexfoster at hotmail.ca> wrote:

> Hi,
> <https://bugs.openjdk.java.net/browse/JDK-8143850>
>
>
> <https://bugs.openjdk.java.net/browse/JDK-8143850>
>
> I did this awhile ago and I'd like to submit it.
>
> I believe it needs to be a new class because it changes the behavior of
> equals and hashcode.
>
> My implementation is based off of the java 8 version I think and it has
> changed a lot since then, I could add some of the improvements if you want.
>
> Also I'm not sure if we should make a new Deque + List interface for it to
> implement or not.
>
>
> Code:
>
> https://pastebin.com/suXMfMZW
>
> Bug:
>
> https://bugs.openjdk.java.net/browse/JDK-8143850
>
> Previous discussion:<https://bugs.openjdk.java.net/browse/JDK-8143850>
>
> <https://bugs.openjdk.java.net/browse/JDK-8143850>http://
> mail.openjdk.java.net/pipermail/core-libs-dev/2014-February/024938.html
>
>
> <https://bugs.openjdk.java.net/browse/JDK-8143850>Alex<ht
> tp://mail.openjdk.java.net/pipermail/core-libs-dev/2014-
> February/024938.html>
>


More information about the core-libs-dev mailing list