Bug 58651

Summary: Javadoc warning for unchecked @throws declaration
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Dani Megert CLA 2004-04-15 10:09:53 EDT
I20040413

I documented an unchecked exception like:
	 * @throws Throwable an unspecified unchecked exception if the object

This gives me a Javadoc warning: Throwable is not declared
Comment 1 Philipe Mulet CLA 2004-04-23 08:47:14 EDT
Don't you have a matching thrown exception in method signature ?
Comment 2 Dani Megert CLA 2004-04-23 09:02:13 EDT
No, but check the two examples where the warnings are once reported and once not:

org.eclipse.text

Assert.isNotNull:
	 * @exception Throwable an unspecified unchecked exception if the object
	 *   is <code>null</code>
	 */
	public static void isNotNull(Object object) {

==> a warning is genereted

org.eclipse.text: FindReplaceDocumentAdapter:
	 * @throws PatternSyntaxException if a regular expression has invalid syntax
	 */
	private IRegion findReplace(FindReplaceOperationCode operationCode, int
startOffset, String findString, String replaceText, boolean forwardSearch,
boolean caseSensitive, boolean wholeWord, boolean regExSearch) throws
BadLocationException {

==> no warning gets generated

Comment 3 Philipe Mulet CLA 2004-04-26 10:01:22 EDT
PatternSyntaxException is an unchecked exception. Therefore we tolerate it to 
be undeclared, as per spec, you don't have to have to declare them, but still 
could want to document them.
Comment 4 Philipe Mulet CLA 2004-04-26 10:01:38 EDT
Ok to close ?
Comment 5 Dani Megert CLA 2004-04-26 10:18:37 EDT
yes