RFR: 8266571: Sequenced Collections
ExE Boss
duke at openjdk.org
Mon Mar 20 23:45:07 UTC 2023
On Tue, 12 Apr 2022 23:25:14 GMT, Stuart Marks <smarks at openjdk.org> wrote:
>> 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.
Won’t `super.keySet()` resolve to a bridge method in that case?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r849394986
More information about the core-libs-dev
mailing list