From 3a57d00dab34bc7def9c575f4e71b739b872a7a9 Mon Sep 17 00:00:00 2001 From: darcy Date: Thu, 24 Jan 2013 16:54:11 -0800 Subject: [PATCH] 8006895: Clarify that FunctionalInferface is only informative Reviewed-by: briangoetz --- .../classes/java/lang/FunctionalInterface.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/share/classes/java/lang/FunctionalInterface.java b/src/share/classes/java/lang/FunctionalInterface.java index 0d4ae72a6..a93ed51f9 100644 --- a/src/share/classes/java/lang/FunctionalInterface.java +++ b/src/share/classes/java/lang/FunctionalInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,9 +28,9 @@ package java.lang; import java.lang.annotation.*; /** - * Indicates that an interface type declaration is intended to be a - * functional interface as defined by the Java Language - * Specification. + * An informative annotation type used to indicate that an interface + * type declaration is intended to be a functional interface as + * defined by the Java Language Specification. * * Conceptually, a functional interface has exactly one abstract * method. Since {@linkplain java.lang.reflect.Method#isDefault() @@ -52,6 +52,11 @@ import java.lang.annotation.*; *
  • The annotated type satisfies the requirements of a functional interface. * * + *

    However, the compiler will treat any interface meeting the + * definition of a functional interface as a functional interface + * regardless of whether or not a {@code FunctionalInterface} + * annotation is present on the interface declaration. + * * @jls 4.3.2. The Class Object * @jls 9.8 Functional Interfaces * @jls 9.4.3 Interface Method Body -- GitLab