Defender Extension Methods -- Resolution and Invoccation

Brian Goetz brian.goetz at oracle.com
Thu Aug 5 05:41:37 PDT 2010


> Correct me if wrong, but did you just point out that default implementations
> can change from release to release? I never considered that. Even if Oracle
> would never do that :-), it is likely other developers will be less
> stringent. Perhaps release X defaults to a quick sort, and release Y
> replaces it with a better sort.

Of course.  Same thing when you extend AbstractList; the superclass 
implementation of size() could change.

> I have strong reservations about making interfaces know anything about
> implementations.

They don't.  The interface is a place to specify the fallback strategy should 
the implementation fail to provide one.

> Would anyone here sign a contract where the other party can freely amend at
> will?

You do so every time you extend a class.  Really.



More information about the lambda-dev mailing list