Bug 147485

Summary: Anonymous type missing from java model
Product: [Eclipse Project] JDT Reporter: Yaniv Inbar <yaniv>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.3 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.