RFR: 8174840: Elements.overrides does not check the return type of the methods

Pavel Rappo prappo at openjdk.org
Mon Jan 6 22:17:37 UTC 2025


On Mon, 6 Jan 2025 22:08:38 GMT, Chen Liang <liach at openjdk.org> wrote:

>> This uses the wording from JLS 8.4.8.1 (emphasis mine):
>> 
>>> An instance method `mC` declared in or inherited by class `C`, overrides **from** `C` another method `mA` declared in class `A`, iff all of the following are true:
>
> Then we should use
> `String.format("%s does not override from %s %s", tm, t.getQualifiedName(), sm)`. `sm` is not from `t`, the override is instead.

If you go with that, consider adding the word "method" in between the last two placeholders to clearly separate them:

> ```from %s method %s"```

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22920#discussion_r1904691737


More information about the compiler-dev mailing list