Bug 96071

Summary: Javadoc for IJavaProject.findType(String ) is not consistant
Product: [Eclipse Project] JDT Reporter: Sébastien Gandon <sgandon>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: trivial    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 RC1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Sébastien Gandon CLA 2005-05-20 05:48:42 EDT
Hello,

the javacdoc for IType org.eclipse.jdt.core.IJavaProject.findType(String
fullyQualifiedName)
says 
"Returns the first type found following this project's classpath with the given
fully qualified name or null if none is found."

and the exception javadoc says
JavaModelException if this element does not exist ......

what is the right one ?
Comment 1 Jerome Lanneluc CLA 2005-05-20 12:45:14 EDT
Both are right. 'this element' refers to the project. So if the project doesn't
exist, a JavaModelException is thrown. If the project exists, and the type is
not found, null is returned. If the type is found, it is returned.

Would changing the spec to 'JavaModelException if this project does not exist'
clarify things ?
Comment 2 Sébastien Gandon CLA 2005-05-23 03:41:28 EDT
yes very much,

thanks for your answer.

SeB.
Comment 3 Jerome Lanneluc CLA 2005-05-23 05:57:41 EDT
Changed the @exception spec of IJavaProject#findType(...),
findPackageFragment(...), and findPackageFragmentRoot(...) to:
@exception JavaModelException if this project does not exist [...]
Comment 4 David Audel CLA 2005-05-27 08:52:04 EDT
Verified in i20050527-0010