On Wed, 13 Apr 2022 19:08:58 GMT, Stuart Marks <sma...@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