Bug 9813 - VerifyError with Inner Class having private constructor
Summary: VerifyError with Inner Class having private constructor
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-14 09:29 EST by Kari Askeland CLA
Modified: 2002-02-19 07:51 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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).