Bug 48350 - IType#resolveType(String) fails on local types
Summary: IType#resolveType(String) fails on local types
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 46938
  Show dependency tree
 
Reported: 2003-12-09 12:59 EST by Markus Keller CLA
Modified: 2004-02-12 10:13 EST (History)
0 users

See Also:


Attachments
Proposed patch (4.13 KB, patch)
2003-12-18 12:51 EST, 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 2003-12-09 12:59:20 EST
I20031203 + jdt.core, etc. from HEAD:

IType#resolveType(String) doesn't resolve "Object" when applied to this local
type 'Local':

public class Outer {
	void foo() {
		class Local {
			void bar() {
				
			}
		}
	}
}

To see it in the debugger:
- set a breakpoint in ChangeSignatureRefactoring#tryResolvingType(String)
- select method 'bar'
- menu Refactoring > Change Method Signature
- add parameter Type:Object Name:object Default:null and click "Preview"
-> breakpoint is hit, resolveType finds nothing
Comment 1 Jerome Lanneluc CLA 2003-12-17 07:17:55 EST
When the breakpoint is hit, the source of the working copy doesn't contain a 
reference to "Object". Thus the resolution doesn't find "Object" and returns 
null.
Comment 2 Jerome Lanneluc CLA 2003-12-17 07:21:32 EST
Sorry, this works for a top level type. Moving back to investigate.
Comment 3 Jerome Lanneluc CLA 2003-12-18 12:51:26 EST
Created attachment 7234 [details]
Proposed patch
Comment 4 Jerome Lanneluc CLA 2004-01-06 04:35:48 EST
Released patch and added regression test 
TypeResolveTests.testResolveTypeInInner2()
Comment 5 David Audel CLA 2004-02-12 10:13:45 EST
Verified for 3.0M7