-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b55
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085357 | emb-9 | Maurizio Cimadamore | P4 | Resolved | Fixed | team |
Originally reported here:
https://twitter.com/rafaelcodes/status/572718220047728640
Indeed, the genNullCheck does:
/** Generate a null check from the object value at stack top. */
private void genNullCheck(DiagnosticPosition pos) {
callMethod(pos, syms.objectType, names.getClass,
List.<Type>nil(), false);
code.emitop0(pop);
}
This may cause the debugging problems due toJDK-8073432.
We might want to switch to Objects.requireNonNull, or generating the explicit NPE check instead.
https://twitter.com/rafaelcodes/status/572718220047728640
Indeed, the genNullCheck does:
/** Generate a null check from the object value at stack top. */
private void genNullCheck(DiagnosticPosition pos) {
callMethod(pos, syms.objectType, names.getClass,
List.<Type>nil(), false);
code.emitop0(pop);
}
This may cause the debugging problems due to
We might want to switch to Objects.requireNonNull, or generating the explicit NPE check instead.
- backported by
-
JDK-8085357 NULLCHK is emitted as Object.getClass
-
- Resolved
-
- relates to
-
JDK-8042127 Performance issues with java.util.Objects.requireNonNull
-
- Open
-
-
JDK-8073432 Object.getClass() throws stackless NPE, due to C2 intrinsic
-
- Resolved
-