Community
Participate
Working Groups
I20050215-0800 enum Col { RED, BROWN(), GREEN(){}; } The IType of the anonymous enum declaration (the child of the IField 'GREEN') says isLocal() == false. I would expect to get true here.
The local type inside the outline is hidden when I filter out local types. So why do you say that the type is not local?
The local types filter (MemberFilter#isLocalType(IType)) does not query #isLocal(), but checks whether an IType's parent is a non-IType IMember. I found the bug when trying to delete an anonymous enum from the outline view: - set a breakpoint in ASTNodeDeleteUtil 1.17, line 45 - delete the enum "{...}" from the outline view
Changed SourceType#isLocal() to handle the case where the parent is an IField. Added regression test LocalElementTests#testAnonymousType6().
Verified for 3.2 M3 using build I20051025-0800+JDT/Core v_618a
See bug 339337, comment #2. The JLS §14.3 says this: "A local class is a nested class (§8) that is not a member of any class and that has a name." And the example given in comment #0 seems satisfy this condition. Should it still be considered a local type?