RFR: fixing bug in null checks generation [v4]

Vicente Romero vromero at openjdk.org
Mon Jan 26 19:36:55 UTC 2026


> Javac is generating erroneous null checks for code like, test case provided by Jan:
> 
> 
> public class Main {
>     public String g() {
>         return Other.str = "";
>     }
> }
> class Other {
>     public static String! str = "";
> }
> 
> so there is no point in generating null checks on the left side of an assignment statement. So the proposal is to use a switch to indicate when null checks shouldn't be generated.
> 
> TIA

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

  fixing another bug

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/1972/files
  - new: https://git.openjdk.org/valhalla/pull/1972/files/e523d58f..520289e3

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

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

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


More information about the valhalla-dev mailing list