RFR: [bworld] Emit lint warnings if overriding method does not have same nullability [v7]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Feb 11 10:03:08 UTC 2026


On Mon, 9 Feb 2026 20:53:31 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties line 4401:
>> 
>>> 4399: # 0: type, 1: type
>>> 4400: compiler.misc.return.type.nullability.mismatch=\
>>> 4401:     return type {0} in the overriding does not match the return type {1}! in the overridden method
>> 
>> You shouldn't need the `!` here -- if the type has restrictions, they should be displayed
>
> if I remove this from the message then the `!` is not issued

Aaaargh!

I never integrated this!

https://git.openjdk.org/valhalla/pull/1921

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/2058#discussion_r2789633959


More information about the valhalla-dev mailing list