Bug 147485 - Anonymous type missing from java model
Summary: Anonymous type missing from java model
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-16 13:16 EDT by Yaniv Inbar CLA
Modified: 2006-08-07 07:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yaniv Inbar CLA 2006-06-16 13:16:54 EDT
Look in the Outline view for the second anonymous type in this file and notice that it is missing:

public class Bug {
	abstract class Abstract {

	}

	{
		new Abstract() {
			class T {
			}

			{
				new Abstract() {
				};
			}
		};
	}
}

Notice also that if you remove class T, the type shows up again.  Notice also that this is a bug in the core JDT java model and not just a UI issue because if you traverse the java model API using getChildren(), it is not returned.

I verified that the same bug happens in both Eclipse 3.2 RC7 and Eclipse 3.1.1.
Comment 1 Jerome Lanneluc CLA 2006-06-26 06:57:16 EDT
Changed Parser#markEnclosingMemberWithLocalType() to also check that the encloing type found on the AST stack is not closed (its declarationSourceEnd is 0) meaning we're parsing it.

Added regression test LocalElementTests#testAnonymousType7().

Released for 3.3 M1 in HEAD.
Comment 2 Frederic Fusier CLA 2006-08-07 07:51:51 EDT
Verified for 3.3 M1 using build I20060807-0010.