Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 186954 - IType.resolveType(String) does not work properly if being called on types that are nested into local ones
Summary: IType.resolveType(String) does not work properly if being called on types tha...
Status: RESOLVED DUPLICATE of bug 186956
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-15 04:41 EDT by Roman Arkhangelskiy CLA
Modified: 2007-05-15 05:02 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Arkhangelskiy CLA 2007-05-15 04:41:41 EDT
Build ID: I20060922-0010

Steps To Reproduce:
1. Consider the class:

package testcase;
public class TestCase {
 void test() {
  class A {
   class B {}
  }
 }
}

2. Any type (e.g. Object or String) can be successfully resolved from within the context of the local type A, whereas this cannot be done from the one of inner type B.

3. A plugin that shows the problem and a workspace containing the test case itself are attached.


More information:
The problem is likely to be caused by the code of org.eclipse.jdt.internal.codeassist.SelectionEngine selectType method (consider the following condition):
...
if (typeHandle.isAnonymous() || typeHandle.isLocal()) 
    flags |= SourceTypeConverter.LOCAL_TYPE;
...
Since the type B in the test case provided does not appear to be either anonymous or local, it has no chance to be considered in further calculations.
Comment 1 Jerome Lanneluc CLA 2007-05-15 05:02:04 EDT

*** This bug has been marked as a duplicate of bug 186956 ***