Defender methods and compatibility

Nathan Bryant nathan.bryant at linkshare.com
Mon Nov 29 16:54:33 PST 2010


Rémi,

Perhaps you raise a good point. If the method one() is supposed to be implemented in terms of the existing interface A or B, does it really make sense in many/any cases to erase the type of that interface down to Object. Seems like this can lead to confusing API design with little clear benefit. If A/B want to specify the same default and yet they have no common superinterface, this seems like a strong signal that a new superinterface should be added.

Nathan

-----Original Message-----
From: Nathan Bryant 
Sent: Monday, November 29, 2010 7:48 PM
To: 'Rémi Forax'; lambda-dev at openjdk.java.net
Subject: RE: Defender methods and compatibility



Rémi wrote: 
> But here the default method of A::get is Implementations.one(A) and
> the default method of B::get is Implementations.one(B).
> It's not the same method.

> Rémi

It could be Implementations.one(Object) I guess.


More information about the lambda-dev mailing list