Community
Participate
Working Groups
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 ?
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 ?
yes very much, thanks for your answer. SeB.
Changed the @exception spec of IJavaProject#findType(...), findPackageFragment(...), and findPackageFragmentRoot(...) to: @exception JavaModelException if this project does not exist [...]
Verified in i20050527-0010