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

Vicente Romero vromero at openjdk.org
Wed Feb 11 17:18:40 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 32 additional commits since the last revision:

 - Merge branch 'bworld' into lint.warning.for.overrides
 - changes to test infra
 - addressing review comments
 - addressing review comment
 - simplifying tests
 - Merge branch 'bworld' into lint.warning.for.overrides
 - minor change
 - adding support for method references
 - doc changes
 - adding support for records
 - ... and 22 more: https://git.openjdk.org/valhalla/compare/ab72a950...ef61c282

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/2058/files
  - new: https://git.openjdk.org/valhalla/pull/2058/files/ed545591..ef61c282

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

  Stats: 248 lines in 8 files changed: 145 ins; 53 del; 50 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