Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 186956

Summary: IType.resolveType(String) does not work properly if being called on types that are nested into local ones
Product: [Eclipse Project] JDT Reporter: Roman Arkhangelskiy <rarkhangelskiy>
Component: CoreAssignee: David Audel <david_audel>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
Plugin that displays the problem
none
test case runtime workspace
none
pligin launch configuration none

Description Roman Arkhangelskiy CLA 2007-05-15 04:42:29 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 Roman Arkhangelskiy CLA 2007-05-15 04:44:53 EDT
Created attachment 67193 [details]
Plugin that displays the problem
Comment 2 Roman Arkhangelskiy CLA 2007-05-15 04:46:01 EDT
Created attachment 67194 [details]
test case runtime workspace
Comment 3 Roman Arkhangelskiy CLA 2007-05-15 04:47:16 EDT
Created attachment 67195 [details]
pligin launch configuration
Comment 4 Jerome Lanneluc CLA 2007-05-15 05:01:53 EDT
*** Bug 186955 has been marked as a duplicate of this bug. ***
Comment 5 Jerome Lanneluc CLA 2007-05-15 05:02:04 EDT
*** Bug 186954 has been marked as a duplicate of this bug. ***
Comment 6 Jerome Lanneluc CLA 2007-05-15 05:02:25 EDT
*** Bug 186953 has been marked as a duplicate of this bug. ***
Comment 7 Eclipse Genie CLA 2020-02-22 07:13:38 EST
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.