Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8074306

NULLCHK is emitted as Object.getClass

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • tools
    • b55
    • Verified

        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 to JDK-8073432.
        We might want to switch to Objects.requireNonNull, or generating the explicit NPE check instead.

              mcimadamore Maurizio Cimadamore
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: