From 1839433bff5587f6a9bede3c765100ae4737fd2e Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 1 Dec 2023 20:24:09 +0000 Subject: [PATCH] 8320941: Discuss receiver type handling Reviewed-by: vromero --- .../javax/lang/model/element/ExecutableElement.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java b/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java index d4c9c881f3b..8bff3748394 100644 --- a/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java +++ b/src/java.compiler/share/classes/javax/lang/model/element/ExecutableElement.java @@ -89,6 +89,17 @@ public interface ExecutableElement extends Element, Parameterizable { * non-inner class, or an initializer (static or instance), has no * receiver type. * + *

The receiver parameter is a syntactic device added + * to the language for the purpose of hosting annotations. Even + * when source code is used as the basis for creating an + * executable, if a receiver parameter is not present in the + * source code, an implementation may elect to return a {@code + * NoType} object even in cases where a receiver type is + * nominally defined on the executable in question, such as an + * instance method. When a receiver parameter is present and + * hosting annotations, a suitably annotated receiver type is + * returned. + * * @return the receiver type of this executable * @since 1.8 *