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

oaki fails to indicate a NullPointerException with static to private method call

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.0alpha
    • CPU:
      sparc
    • OS:
      solaris_1
    • Verification:
      Not verified

      Description

      In the following example, t is null, yet the method simpleMethod is called
      rather than a NullPointerException being signaled. The println in simpleMethod()
      prints This is <Null Object> which is completely wrong.

      There must be a missing null check in invokenonvirtual, which is the opcode being
      generated by the compiler (since simpleMethod is a private method).

      public class test {
          static void staticTest() {
      test t = null;

      t.simpleMethod();
          }

          private void simpleMethod() {
      System.out.println("This is " + this);
          }

          public static void main(String args[]) {
      staticTest();
          }
      }

        Attachments

          Activity

            People

            Assignee:
            fyellinsunw Frank Yellin (Inactive)
            Reporter:
            jpayne Jonathan Payne (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: