AbstractList etc. functionality as interfaces with default methods?
Pavel Rappo
pavel.rappo at oracle.com
Fri May 8 10:15:14 UTC 2015
> (I’ll hand-wave the issue of “protected int modCount” issue for now.)
Not only. Consider this: java.util.AbstractList overrides some methods from
java.lang.Object such as equals and hashCode. And this is a no-no [1]:
...It is a compile-time error if a default method is override-equivalent
with a non-private method of the class Object, because any class
implementing the interface will inherit its own implementation of the
method...
-------------------------------------------------------------------------------
[1] https://docs.oracle.com/javase/specs/jls/se8/html/jls-9.html#jls-9.4.1.2
More information about the core-libs-dev
mailing list