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

Liam Miller-Cushon cushon at openjdk.org
Wed Oct 8 17:21:22 UTC 2025


On Wed, 8 Oct 2025 14:28:51 GMT, Chen Liang <liach at openjdk.org> wrote:

> A similar diagnostic `compiler.err.does.not.override.abstract` reports both the method and the problematic class without the method. Should `compiler.err.method.does.not.override.superclass` also report both the method and the current class of the current method?

For `compiler.err.does.not.override.abstract`, the problematic code in the current compilation unit is a class, which is shown, and javac also shows the method that isn't being overridden and its enclosing class.

For `compiler.err.method.does.not.override.superclass` the problematic code in the current compilation unit is a method, which is now shown. (We don't know which superclass or supermethod would be relevant, since we couldn't resolve a supermethod.)

So I do see a bit of a distinction whether the element is in the current source file or not. If it's in the current source file I think it's still valuable to have some context, but maybe just the method and not the method and also it's containing class is sufficient? What do you think?

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

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


More information about the compiler-dev mailing list