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

Brian Goetz brian.goetz at oracle.com
Wed Jan 16 16:08:12 UTC 2013

There is a benefit for languages *other* than Java, that can use this as a means to determine whether the interface is suitable for passing to the SAM conversion machinery.  The JDK support for lambda conversion is available to other languages as well.  

On Jan 16, 2013, at 1:51 AM, Florian Weimer wrote:

> On 01/16/2013 07:54 AM, Joe Darcy wrote:
>> Hi Florian,
>> On 1/10/2013 1:23 AM, Florian Weimer wrote:
>>> On 01/08/2013 10:24 PM, Joe Darcy wrote:
>>>> 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/
>>> Shouldn't this annotation have @Retention(RetentionPolicy.SOURCE),
>>> similar to the @Override annotation?
>> No; we intentionally made this annotation have runtime retention to
>> allow it to also be queried to various tools at runtime, etc.
> This is really a bit odd.  Doesn't this risk that code will rely on the annotation, instead of inferring the functional interface status based on the interface contents?
> I could not find this part in the lambda-libs-spec-experts discussion. Have you got a more specific pointer?
> -- 
> Florian Weimer / Red Hat Product Security Team

More information about the core-libs-dev mailing list