Bug 122444 - [hierarchy] Type hierarchy of inner member type misses anonymous subtypes
Summary: [hierarchy] Type hierarchy of inner member type misses anonymous subtypes
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.3 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-01 17:26 EST by Markus Keller CLA
Modified: 2006-08-07 05:40 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch and regression test (13.11 KB, patch)
2006-06-16 07:10 EDT, Jerome Lanneluc CLA
no flags Details | Diff

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