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

Vicente Romero vromero at openjdk.org
Mon Feb 9 23:10:54 UTC 2026


> emit a lint warning for cases like:
> 
> class Test {
>     String! m(String s) { return ""; }
> }
> class Sub extends Test {
>     @Override
>     String m(String s) { return null; }
> }
> 
> or:
> 
> class Test {
>     String m(String! s) { return ""; }
> }
> class Sub extends Test {
>     @Override
>     String m(String s) { return null; }
> }

Vicente Romero has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 22 additional commits since the last revision:

 - Merge branch 'bworld' into lint.warning.for.overrides
 - minor change
 - minor change
 - removing commented code
 - addressing review comments
 - minor code change
 - adding separate compilation test
 - updating tests
 - another update
 - reducing common code
 - ... and 12 more: https://git.openjdk.org/valhalla/compare/fd80fa28...693bdc29

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/2058/files
  - new: https://git.openjdk.org/valhalla/pull/2058/files/fd10017d..693bdc29

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=2058&range=02
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2058&range=01-02

  Stats: 1865 lines in 78 files changed: 405 ins; 1303 del; 157 mod
  Patch: https://git.openjdk.org/valhalla/pull/2058.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2058/head:pull/2058

PR: https://git.openjdk.org/valhalla/pull/2058


More information about the valhalla-dev mailing list