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

Joe Darcy joe.darcy at oracle.com
Tue Jan 8 22:00:55 UTC 2013

Hi Mike,

On 01/08/2013 01:49 PM, Mike Duigou wrote:
> Perhaps {@code} around java.lang.Object.


> 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



> 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