RFR: 8266571: Sequenced Collections
Stuart Marks
smarks at openjdk.org
Mon Mar 20 23:45:07 UTC 2023
On Tue, 12 Apr 2022 19:55:13 GMT, Eamonn McManus <emcmanus at openjdk.org> wrote:
>> PR for Sequenced Collections implementation.
>
> src/java.base/share/classes/java/util/LinkedHashMap.java line 604:
>
>> 602: * @return a set view of the keys contained in this map
>> 603: */
>> 604: public SequencedSet<K> keySet() {
>
> Changing the return type means that subclasses of `LinkedHashMap` that override `keySet()` will no longer compile, unless they also change the return type.
Yes. Previously compiled binaries will also throw `NoSuchMethodError` if they call `super.keySet()`. Clearly these are incompatibilities; the question is whether they are severe enough to warrant pursuing a different approach. If you have any thoughts about how to assess the severity of this change, please let me know.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r848945910
More information about the core-libs-dev
mailing list