RFR: 8369428: Include method name in 'does not override or implement' diagnostics
Liam Miller-Cushon
cushon at openjdk.org
Thu Oct 23 08:28:09 UTC 2025
On Wed, 8 Oct 2025 18:35:23 GMT, Chen Liang <liach 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
>
> 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.
@liach how does the current version of this look to you?
Does anyone else have feedback on the proposed diagnostic changes?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27692#issuecomment-3435713502
More information about the compiler-dev
mailing list