Is Comparator SAM interface ?

Alex Buckley Alex.Buckley at Sun.COM
Mon Jan 11 11:27:40 PST 2010


Neal Gafter wrote:
> On Sun, Jan 10, 2010 at 10:02 AM, Artur Biesiadowski <abies at adres.pl> wrote:
>> For the function conversion, straw-man proposal is expecting interfaces
>> defining just one method. It might require wording differently - if read
>> literally, java.util.Comparator is not suitable for function conversion,
>> because it restates 'equals' in the interface in addition to compare.
>> Same goes for Predicate in google collections and probably some other
>> classes in different libraries.
> 
> Until we have a draft specification, it's hard to know if this is an
> issue or not.  This is on the open issue list of CfJ 0.6a at
> <http://www.javac.info/issues-v06a.html>, fourth item.

Yes. Sun is well aware of the need to define "single abstract method" in 
a precise and useful manner that considers the points in the CfJ list 
and your "Comments on the straw man..." mail. The most interesting 
question is whether to count multiple methods as a single method in any 
circumstance; an earlier mail from Mahmood Ali about not being able to 
disambiguate between overloads in the SAM type is relevant here. (We 
wondered if anyone would spot that potential ambiguity :-)

The draft specification takes a position on all of this. I hope to send 
it later this week, and then everyone can find their angle on it.

Alex


More information about the lambda-dev mailing list