JDK 8 code review request for 8005298 Add FunctionalInterface type to the core libraries

Mike Duigou mike.duigou at oracle.com
Wed Jan 9 00:02:30 UTC 2013


Looks good now.

Mike

On Jan 8 2013, at 14:43 , Joe Darcy wrote:

> PS The updated webrev is
> 
>    http://cr.openjdk.java.net/~darcy/8005298.1/
> 
> Thanks,
> 
> -Joe
> 
> On 01/08/2013 02:00 PM, Joe Darcy wrote:
>> Hi Mike,
>> 
>> On 01/08/2013 01:49 PM, Mike Duigou wrote:
>>> Perhaps {@code} around java.lang.Object.
>> 
>> Agreed.
>> 
>>> 
>>> The default method and overriding Object method sentences could perhaps be said more simply:
>>> 
>>> {@linkplain  java.lang.reflect.Method#isDefault() default methods} in interfaces do provide a method implementation and are not considered abstract.
>>> 
>>> Interface methods which match methods of java.lang.Object are not considered abstract because an implementation (from java.lang.Object) is always available.
>>> 
>>> Mostly it's enough to say that they aren't abstract. The part about abstract method count is superfluous.
>> 
>> Okay; rewritten as:
>> 
>> * Conceptually, a functional interface has exactly one abstract
>> * method.  Since {@linkplain java.lang.reflect.Method#isDefault()
>> * default methods} have an implementation, they are not abstract. If
>> * an interface declares an abstract method overriding one of the
>> * public methods of {@code java.lang.Object}, that also does
>> * <em>not</em> count toward the interface's abstract method count
>> * since any implementation of the interface will have an
>> * implementation from {@code java.lang.Object} or elsewhere.
>> 
>>> 
>>> @jls ref for default methods.
>> 
>> That is actually included in the draft text of 9.4.3 and so is covered by
>> 
>> * @jls 9.4.3 Interface Method Body
>>> 
>>> @jls ref for methods of Object.
>> 
>> That is a good addition; I'll include
>> 
>> * @jls 4.3.2. The Class Object
>> 
>> Thanks,
>> 
>> -Joe
>> 
>>> 
>>> On Jan 8 2013, at 13:24 , Joe Darcy wrote:
>>> 
>>>> Hello,
>>>> 
>>>> As discussed over on one of the Project Lambda lists [1], we're adding an interface type to the platform to explicitly mark interface types as being functional interfaces suitable for use in lambda expressions.  Please review the addition of this new type:
>>>> 
>>>>    http://cr.openjdk.java.net/~darcy/8005298.0/
>>>> 
>>>> Follow-up work will add @FunctionalInterface annotations to appropriate platform classes.
>>>> 
>>>> Thanks,
>>>> 
>>>> -Joe
>>>> 
>>>> [1] http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/2012-December/000846.html
>> 
> 




More information about the core-libs-dev mailing list