Bug 96071 - Javadoc for IJavaProject.findType(String ) is not consistant
Summary: Javadoc for IJavaProject.findType(String ) is not consistant
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 trivial (vote)
Target Milestone: 3.1 RC1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-20 05:48 EDT by Sébastien Gandon CLA
Modified: 2005-05-27 08:52 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 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