RFR: 8369428: Include method name in 'does not override or implement' diagnostics

Liam Miller-Cushon cushon at openjdk.org
Wed Oct 8 20:58:30 UTC 2025


On Wed, 8 Oct 2025 18:35:23 GMT, Chen Liang <liach at openjdk.org> wrote:

> I think a better analogy would be `compiler.err.default.overrides.object.member`: it is also a problematic method overriding. It reports the method, the declaring class's kind (class or interface), and the declaring class in the current source file. I think we can just emulate that message here.

Ok, thanks! I can take a look at converging on showing both the method and declaring class.

Another thing I notice about `compiler.err.default.overrides.object.member` is that it takes the method name, not the type (which would result in formatting the method signature). Other method diagnostics take a type. Do you have thoughts on when to make the distinction?

One more weird thing about `compiler.err.default.overrides.object.member` is that it takes a kind, but as far as I can tell will only ever be reported for interfaces, `default` methods in non-interface types would be rejected earlier.

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

PR Comment: https://git.openjdk.org/jdk/pull/27692#issuecomment-3383210315


More information about the compiler-dev mailing list