RFR: 8266571: Sequenced Collections

Stuart Marks smarks at openjdk.org
Mon Mar 20 23:45:07 UTC 2023


On Wed, 13 Apr 2022 19:08:58 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>> Won’t `super.keySet()` resolve to a bridge method in that case?
>
> Oh yes, in this case it might resolve to a bridge method, and it might actually work. In this case. However, the compatibility matrix for covariant overrides and bridge methods is quite complex; see
> 
> https://mail.openjdk.java.net/pipermail/core-libs-dev/2012-February/009119.html
> 
> for why we decided not to add covariant `clone` overrides. Similar issues might arise here.

For what it's worth, I've done a detailed compatibility analysis of the cases here, and I've decided that adding covariant overrides for keySet/values/entrySet is too dangerous. See the full analysis in the documents attached to the CSR request:

https://bugs.openjdk.org/browse/JDK-8266572

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r1012392883


More information about the core-libs-dev mailing list