Integrated: 8319196: ExecutableElement.getReceiverType doesn't return receiver types for methods loaded from bytecode

Liam Miller-Cushon cushon at openjdk.org
Tue Nov 14 17:41:41 UTC 2023


On Thu, 2 Nov 2023 18:01:20 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

> Hello,
> 
> Please consider this fix for [JDK-8319196: ExecutableElement.getReceiverType doesn't return receiver types for methods loaded from bytecode](https://bugs.openjdk.org/browse/JDK-8319196).
> 
> As discussed in [the accompanying CSR](https://bugs.openjdk.org/browse/JDK-8319330), `ExecutableElement.getReceiverType()` and `ExecutableType.getReceiverType()` currently returns `NoType` unless the receiver parameter syntax was present in source, which also means that `getReceiverType()` doesn't work for methods loaded from class files.
> 
> This change updates the implementation to check if type annotations are present on the receiver type of a method read from bytecode, and fill in the receiver type of that method to host the type annotations.

This pull request has now been integrated.

Changeset: 346dbd6d
Author:    Liam Miller-Cushon <cushon at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/346dbd6d1c1ac24da374dcdf4f432c0adf68efeb
Stats:     108 lines in 4 files changed: 79 ins; 14 del; 15 mod

8319196: ExecutableElement.getReceiverType doesn't return receiver types for methods loaded from bytecode

Reviewed-by: vromero

-------------

PR: https://git.openjdk.org/jdk/pull/16482


More information about the compiler-dev mailing list