提交 3a57d00d 编写于 作者: D darcy

8006895: Clarify that FunctionalInferface is only informative

Reviewed-by: briangoetz
上级 da39443b
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -28,9 +28,9 @@ package java.lang; ...@@ -28,9 +28,9 @@ package java.lang;
import java.lang.annotation.*; import java.lang.annotation.*;
/** /**
* Indicates that an interface type declaration is intended to be a * An informative annotation type used to indicate that an interface
* <i>functional interface</i> as defined by the Java Language * type declaration is intended to be a <i>functional interface</i> as
* Specification. * defined by the Java Language Specification.
* *
* Conceptually, a functional interface has exactly one abstract * Conceptually, a functional interface has exactly one abstract
* method. Since {@linkplain java.lang.reflect.Method#isDefault() * method. Since {@linkplain java.lang.reflect.Method#isDefault()
...@@ -52,6 +52,11 @@ import java.lang.annotation.*; ...@@ -52,6 +52,11 @@ import java.lang.annotation.*;
* <li> The annotated type satisfies the requirements of a functional interface. * <li> The annotated type satisfies the requirements of a functional interface.
* </ul> * </ul>
* *
* <p>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 4.3.2. The Class Object
* @jls 9.8 Functional Interfaces * @jls 9.8 Functional Interfaces
* @jls 9.4.3 Interface Method Body * @jls 9.4.3 Interface Method Body
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册