[lworld] RFR: 8267503: [lworld] [lw3] NPE message thrown by checkcast is incorrect

Frederic Parain fparain at openjdk.java.net
Thu May 20 17:39:10 UTC 2021


Please review those changes fixing the error message for NullPointerExceptions thrown by checkcast.

Without the fix:
java.lang.NullPointerException: There cannot be a NullPointerException at bci 23 of method void NPECheckcastTest.main(java.lang.String[])

With the fix:
java.lang.NullPointerException: Cannot cast to null-free type "QNPECheckcastTest$C1;" because "<local2\>" is null

Thank you,

Fred

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

Commit messages:
 - Fix error message for NPE thrown by checkcast

Changes: https://git.openjdk.java.net/valhalla/pull/418/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=418&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8267503
  Stats: 6 lines in 1 file changed: 6 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/418.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/418/head:pull/418

PR: https://git.openjdk.java.net/valhalla/pull/418



More information about the valhalla-dev mailing list