Bug 23731

Summary: AST: DCR: getSourcePath
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Jim des Rivieres <jeem>
Status: RESOLVED INVALID QA Contact:
Severity: enhancement    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Martin Aeschlimann CLA 2002-09-18 10:54:55 EDT
20020917

A ITypeBinding can be asked if it is from source (isFromSource).
I now need to find this source file.
It is possible to do this using IJavaProject and search for the type. However, 
as the compiler already knows the path, it would be convenient if a method
'getSourceFilePath' would exist.
Comment 1 Olivier Thomann CLA 2002-09-18 11:01:39 EDT
API question should be sent to Jim.
Comment 2 Philipe Mulet CLA 2002-09-19 07:35:22 EDT
A binding doesn't remember where it came from. A source lookup action need to 
be perfomed using existing JavaModel API:

IJavaProject#findType(String packageName, String typeQualifiedName) throws 
JavaModelException;

Isn't this enough ?
Comment 3 Martin Aeschlimann CLA 2002-09-19 07:50:12 EDT
That's how I do it, it works.
I was thinking the binding would know the source location (it knows that it's 
from source), so we could avoid eventual problems with findType not finding a 
non public top level typ.
Comment 4 Philipe Mulet CLA 2002-09-19 08:42:49 EDT
As I said, the binding doesn't keep this information.
Ok to close?
Comment 5 Martin Aeschlimann CLA 2002-09-19 09:09:08 EDT
closing