The receiver parameter language structure was added in Java SE 8 as part of the type annotations effort. Receiver parameters provide a syntactic structure to associate annotations, when need, with a method's receiver or a nested constructor's enclosing class.
The javax.lang.model API was augmented to include methods to return the receiver *type* (JDK-8007803). Conceptually, a receiver type exists whether or not the syntax of a receiver parameter is present.
However, javac's implementation of the language model only exposes non-trivial receiver types if the receiver parameter syntax was present in the sources.
The javax.lang.model API was augmented to include methods to return the receiver *type* (
However, javac's implementation of the language model only exposes non-trivial receiver types if the receiver parameter syntax was present in the sources.
- csr for
-
JDK-8271703 Examine ExecutableType.getReceiverType behavior when source receiver parameter is absent
-
- Closed
-
- relates to
-
JDK-8320941 Discuss receiver type handling
-
- Resolved
-
-
JDK-8222369 ExecutableElement.getReceiverType returns null instead of NOTYPE
-
- Resolved
-
-
JDK-8319196 ExecutableElement.getReceiverType doesn't return receiver types for methods loaded from bytecode
-
- Resolved
-
-
JDK-8007803 Implement javax.lang.model API for Type Annotations
-
- Resolved
-
(2 links to)