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

Liam Miller-Cushon cushon at openjdk.org
Wed Oct 8 14:24:56 UTC 2025


On Wed, 8 Oct 2025 14:12:57 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:

> Hi,
> 
> Please consider this small improvement to `compiler.err.method.does.not.override.superclass` diagnostics, to include the method name.
> 
> Before:
> 
> 
> T.java:2: error: method does not override or implement a method from a supertype
>   @Override
>   ^
> 
> 
> After:
> 
> 
> T.java:2: error: f() does not override or implement a method from a supertype
>   @Override
>   ^
> 1 error

There are a few other diagnostics that might also benefit from this approach, like `static methods cannot be annotated with @Override` and `missing method body, or declare abstract`. If this change makes sense overall I'm happy to update them too, either here or as a follow-up.

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

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


More information about the compiler-dev mailing list