Yes it is now possible to implement the methods `getKey(Object key)` and `getEntry(Object key)` requested by JDK-6552529 as default methods, however both would have to include that "The default implementation returns the provided key. Overriding implementations may return the actual key used by the map." In this case it is questionable how useful the methods actually are, e.g. Two key objects k1 and k2 with `k1.equals(k2)` Two objects m1 and m2 of different map implementations both containing k1. Then the following is possible: m1.getKey(k2) == k2 // true m2.getKey(k2) == k2 // false
> Brian Goetz <brian.go...@oracle.com> hat am 7. Januar 2019 um 00:54 > geschrieben: > > > FYI, the comment about compatibility was obsoleted by the addition of > default methods in Java 8.