Bug 29636 - First anonymous type should be named X$1
Summary: First anonymous type should be named X$1
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-16 10:34 EST by Philipe Mulet CLA
Modified: 2003-02-12 08:46 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 Philipe Mulet CLA 2003-01-16 10:34:03 EST
Build 2.1M4

On the following example, the first anonymous (subclass of X) should 
be named X$1. It is currently X$2, where the latter anonymous type get 
generated as X$1.

public class X {
	class A {
	}
	public static void main(String[] arguments) {
		new X(){}.new A(){};
	}
}
Comment 1 Philipe Mulet CLA 2003-01-16 10:36:23 EST
Local type constantpool computation occurs during codegen. As a consequence, 
since the name of the anonymous subclass of A is required first (enclosing 
instance is generated just after new<anonymous-sub-A> bytecode sequence), the 
ordering is wrong.

Can be fixed by moving the naming to the flow analysis where the proper order 
is used to traverse the parse tree.
Comment 2 Philipe Mulet CLA 2003-01-16 10:41:59 EST
Fixed. Constant pool names are now computed during flow analysis.
Comment 3 David Audel CLA 2003-02-12 08:46:54 EST
Verified.