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

NullPointerException instead of NoClassDefFoundError.

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1.6
    • CPU:
      x86
    • OS:
      windows_nt
    • Verification:
      Not verified

      Backports

        Description



        Name: akC45999 Date: 05/08/98



        The following test contains reference to nonexistent class:

        invokeinterface InterfaceMethod NONEXISTENT.mthd:"()V", 1;

        While executing under win32 version of jdk1.2beta4D and jdk1.2beta3
        with JIT, the test throws NullPointerException.
        Without JIT, correct NoClassDefFoundError is thrown.


        ------------------------------------- ClassInterf00201.jasm
        //File: @(#)ClassInterf00201.jasm 1.2 97/07/20
        //Copyright 07/20/97 Sun Microsystems, Inc. All Rights Reserved
        //package javasoft/sqe/tests/vm/constantpool/ClassInterf002/ClassInterf00201;


        super class clss
        {

        public Method <init>:"()V"
        stack 3 locals 1
        {
        aload_0;
        dup;
        invokespecial Method java/lang/Object.<init>:"()V";

        invokeinterface InterfaceMethod NONEXISTENT.mthd:"()V", 1;
        return;
        }

        } // end Class clss


        public super class ClassInterf00201
        {

        public static Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I"
        stack 2 locals 3
        {
        try t1;
        new class clss;
        dup;
        invokespecial Method clss.<init>:"()V";
        astore_2;
        iconst_2;
        ireturn;
        endtry t1;
        catch t1 java/lang/NoClassDefFoundError;
        pop;
        iconst_0;
        ireturn;

        }

        public static Method main:"([Ljava/lang/String;)V"
        stack 2 locals 1
        {
        aload_0;
        getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
        invokestatic Method run:"([Ljava/lang/String;Ljava/io/PrintStream;)I";
        bipush 95;
        iadd;
        invokestatic Method java/lang/System.exit:"(I)V";
        return;
        }


        } // end Class ClassInterf00201
        ------------------------------------- end of file ClassInterf00201.jasm

        Running the test:
        c:/java/dest/jdk1.2beta3/bin/java.exe javasoft.sqe.jasm.Main -d classes -g ClassInterf00201.jasm
        0

        c:/java/dest/jdk1.2beta3/bin/java.exe -verify ClassInterf00201
        Exception in thread "main" java.lang.NullPointerException
        at ClassInterf00201.run(Compiled Code)
        at ClassInterf00201.main(ClassInterf00201.jasm:49)
        1

        e:/ld14/java/dest/jdk1.2b4D/win32/bin/java.exe -verify ClassInterf00201
        Exception in thread "main" java.lang.NullPointerException
        at ClassInterf00201.run(Compiled Code)
        at ClassInterf00201.main(ClassInterf00201.jasm:49)
        1

        JAVA_COMPILER=NULL; export JAVA_COMPILER
        e:/ld14/java/dest/jdk1.2b4D/win32/bin/java.exe -verify ClassInterf00201
        Warning: JIT compiler "NULL" not found. Will use interpreter.
        95

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

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  dviswanasunw Deepa Viswanathan (Inactive)
                  Reporter:
                  rfqsunw Rfq Rfq (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: