RFR: [bworld] Emit lint warnings if overriding method does not have same nullability [v2]
Vicente Romero
vromero at openjdk.org
Mon Feb 9 21:52:09 UTC 2026
On Fri, 6 Feb 2026 00:42:02 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Vicente Romero has updated the pull request incrementally with 20 additional commits since the last revision:
>>
>> - minor change
>> - minor change
>> - removing commented code
>> - addressing review comments
>> - minor code change
>> - adding separate compilation test
>> - updating tests
>> - another update
>> - reducing common code
>> - adding support for explicit lambdas
>> - ... and 10 more: https://git.openjdk.org/valhalla/compare/4c1b385b...fd10017d
>
> test/langtools/tools/javac/nullability/NullabilityCompilationTests.java line 319:
>
>> 317: class Sub extends Test {
>> 318: @Override
>> 319: String m(String s) { return null; }
>
> I think this should be no-warning, instead we should emit warning if Test.m does not have ! but Sub.m has, meaning test.m(null) call will fail on Sub.
yes you have a point, we should double check with Dan
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/2058#discussion_r2775342116
More information about the valhalla-dev
mailing list