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

Nizar Benalla nbenalla at openjdk.org
Mon Jan 6 12:39:58 UTC 2025


On Mon, 6 Jan 2025 03:42:41 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Please review this PR to clarify the documentation of `Elements.overrides` through an `@apiNote`, this PR is essentially a doc-only change. This PR supersedes https://github.com/openjdk/jdk/pull/22244.
>> 
>> TIA.
>
> src/java.compiler/share/classes/javax/lang/model/util/Elements.java line 785:
> 
>> 783:      * specified in JLS {@jls 8.4.8.1} and {@jls 8.4.8.3}. In particular, the additional constraints
>> 784:      * on thrown types, return types and those constraints on method modifiers not directly
>> 785:      * bound to the overriding relation as such.
> 
> Suggestion:
> 
>      * on exception types, return types, and method modifiers do not affect
>      * the overriding relation.
> 
> 
> The original wording has grammatical mistake and makes no sense.

I don't agree that it makes no sense but I find this wording simpler, so I'll use it instead.

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

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


More information about the compiler-dev mailing list