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

NULLCHK is emitted as Object.getClass

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b55
    • Verification:
      Verified

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: