Bug 122444

Summary: [hierarchy] Type hierarchy of inner member type misses anonymous subtypes
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: frederic_fusier
Version: 3.2   
Target Milestone: 3.3 M1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch and regression test none

Description Markus Keller CLA 2006-01-01 17:26:09 EST
I20051215-1506

The type hierarchy of Inner misses the anoymous subtype:

class Outer {
    public class Inner {} // (non-static) inner member type
    public static class StaticMember {}
}

class Use {
    void m(Outer arg) {
        arg.new Inner() {}; // anonymous not in type hierarchy of Inner
        new Outer() {};
        new Outer.StaticMember() {};
    }
}

Maybe connected to bug 120667 (anonymous enums not in hierarchy)
Comment 1 Jerome Lanneluc CLA 2006-06-16 07:10:35 EDT
Created attachment 44628 [details]
Proposed patch and regression test

Problem comes from the fact that the SourceTypeElementInfo doesn't have the allocation expression needed to correctly recreate the QualifiedAllocationExpression.

Fix consists in creating a special SourceTypeElementInfo in the case of an anonymous type of a member type. When the SourceTypeConverter is invoked on such a type, an exception is thrown and caught, then a full parse is done.
Comment 2 Jerome Lanneluc CLA 2006-06-16 07:12:32 EDT
Fix and tests released for 3.3M1 in HEAD.
Comment 3 Frederic Fusier CLA 2006-08-07 05:40:02 EDT
Verified for 3.3 M1 using build I20060807-0010.

However, it seems that it was already fixed in 3.2 build (ie. the anonymous subtype already appears in the hierarchy of Inner). So, I wonder if the fix is really necessary?