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

Chen Liang liach at openjdk.org
Mon Jan 6 12:39:57 UTC 2025


On Sun, 5 Jan 2025 22:16:45 GMT, Nizar Benalla <nbenalla 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.

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

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


More information about the compiler-dev mailing list