Bug 9813

Summary: VerifyError with Inner Class having private constructor
Product: [Eclipse Project] JDT Reporter: Kari Askeland <kari>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P1    
Version: 2.0   
Target Milestone: 2.0 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Kari Askeland CLA 2002-02-14 09:29:40 EST
/*
 * This class compiles and runs using JDK 1.3.1 and JDK 1.4 from the command 
line
 * In Eclipse Build 20020125 get VerifyError at runtime:
 * 
 * java.lang.VerifyError: (class: VE_Test, method: test signature: ()V) 
 * Must call initializers using invokespecial
 * Exception in thread "main" 
 * 
 */
public class VE_Test
{

    class VE_Inner
    {
        private VE_Inner()
        {
            
        }

    }

    private static void test()
    {

        VE_Test ve_test = new VE_Test();
        VE_Inner pi = ve_test.new VE_Inner();

    }

    public static void main(String[] args)
    {
        new VE_Test();
        System.out.println("Hello world");
    }

}
Comment 1 Philipe Mulet CLA 2002-02-15 07:11:10 EST
Excellent find, thanks for the test case.

We did indeed misgenerate code for such qualified allocations (Note that if you 
had been in a context where no enclosing instance had been necessary for 
allocation the innerclass, we would have produced correct bytecodes).

Regression test added, test will be released into next integration build (after 
milestone-3 unfortunately).