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

Chen Liang liach at openjdk.org
Mon Jan 6 19:20:36 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.

test/langtools/tools/javac/processing/model/util/elements/overrides/S.java line 2:

> 1: /*
> 2:  * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.

Is the beginning copyright year 2023 correct?

test/langtools/tools/javac/processing/model/util/elements/overrides/TestOverrides.java line 54:

> 52:                 if (!elements.overrides(tm, sm, t))
> 53:                     messager.printError(String.format(
> 54:                             "%s does not override %s from %s", tm, sm, t.getQualifiedName()));

This message implies `sm` is from `t`, which is not the case. Consider improving the failure message.

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

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


More information about the compiler-dev mailing list