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

(interpreter) NullPointerException instead IncompatibleClassChangeError

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description



      Name: akC45999 Date: 09/08/98



      The section "6.4 The Java Virtual Machine Instruction Set" of JVM specification
      says about linking exeptions for invokespecial instruction:

      " ... if the resolved method is a class (static) method, the
      invokespecial instruction throws an IncompatibleClassChangeError."

      But JDK1.2fcsI JVM on Solaris(jit) throws NullPointerException instead.


      SOURCE:
      ------------------------------------- file invokespecial01801m1.java
      // simplified version of the test invokespecial01801m1

      import java.io.PrintStream;

      public class invokespecial01801m1 {

      public static int run(String argv[], PrintStream out) {

      Class expectedException = IncompatibleClassChangeError.class;
      String badClassName = "invokespecial01801m11n";
      Class badClass = null;

      try {
      badClass = Class.forName(badClassName);
      try {
      Object obj=badClass.newInstance();
      } catch (Throwable e) {
      if (expectedException.isInstance(e)) {
      out.println("Passed with runtime exception: " + e);
      return 0/*STATUS_PASSED*/;
      } else {
      out.println("Failed with unexpected runtime exception: " + e);
      return 2/*STATUS_FAILED*/;
      }
      }
      } catch (ClassNotFoundException e) {
      out.println("Passed with loading exception: " + e);
      return 0/*STATUS_PASSED*/;
      }
      return 2/*STATUS_FAILED*/;
      }

      public static void main(String args[]) {
      System.exit(run(args, System.out) + 95/*STATUS_TEMP*/);
      }

      }

      ------------------------------------- end of file invokespecial01801m1.java

      and

      ------------------------------------- file invokespecial01801m11n.jasm

      public class invokespecial01801m11n {

       static Method proc2:"()V" // wrong
      stack 2 locals 5
      {
      return;
      }

      public Method <init>:"()V"
      stack 2 locals 1
      {
      aload_0;
      invokespecial Method java/lang/Object.<init>:"()V";
      aload_0;
      invokespecial Method proc2:"()V";
        return;
      }

      } // end Class invokespecial01801m11n

      ------------------------------------- end of file invokespecial01801m11n.jasm

      LOG:

      novo50%java -fullversion
      java full version "JDK-1.2fcs-I"

      // Running the test with JIT:
      novo50%java -verify invokespecial01801m1
      Failed with unexpected runtime exception: java.lang.NullPointerException

      // Running the test without JIT:
      novo50% setenv JAVA_COMPILER none
      java -verify invokespecial01801m1
      Warning: JIT compiler "none" not found. Will use interpreter.
      Passed with runtime exception: java.lang.IncompatibleClassChangeError: invokespecial01801m11n: method proc2()V did not used to be static

      ----------------------------------------- end of log

      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              coleenp Coleen Phillimore
              Reporter:
              rfqsunw Rfq Rfq (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: