Community
Participate
Working Groups
Created attachment 255183 [details] Demo project (containing the visitor and logic to create the example project) Example code: public class T { public static void m() { new C() { }; // [1] Consumer<?> c = l -> { new C() { }; // [2] }; } } class C { } Applying following visitor to this example program allows to construct the type hierarchy of the anonymous class of "new C() { }": class AnonymousClassVisitor extends ASTVisitor { public boolean visit(AnonymousClassDeclaration typeDeclaration) { IType type = (IType) typeDeclaration.resolveBinding().getJavaElement(); ITypeHierarchy newSupertypeHierarchy = type.newSupertypeHierarchy(new NullProgressMonitor()); IType superclass = newSupertypeHierarchy.getSuperclass(type); /* [3] */ } } At [3], superclass is well initialized when handling the anonymous class declaration denoted with [1] (pointing to class C). It is, however null (!) when handling the declaration denoted with [2], occuring in a lambda expression. The attachment contains demo code for this problem, providing logic to create the demo project in the runtime eclipse and applying the mentioned visitor.
(Might be related to #472714 ???)
This might be related to anonymous type occurrence count. Will take a look during 4.7.
Bulk move out of 4.8
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.