RFR: fixing bugs in NullChecksWriter [v4]

Vicente Romero vromero at openjdk.org
Mon Jan 12 15:54:50 UTC 2026


> fixing some bugs in NullChecksWriter, reported by John Rose. In particular there was no null check being generated by javac for code like:
> 
> 
> class Test {
>     void m(String someObject) {
>         String! x = "foo";
>         x = (String)someObject;  // no null check generated here
>     }
> 
>     public static void main(String... args) {
>         new Test().m(null);
>     }
> }

Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:

  adding tests for return type

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1883/files
  - new: https://git.openjdk.org/valhalla/pull/1883/files/425fe84f..77ae976b

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

  Stats: 20 lines in 1 file changed: 20 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/valhalla/pull/1883.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1883/head:pull/1883

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


More information about the valhalla-dev mailing list