Bug 94308

Summary: [1.5][compiler] @SuppressWarnings("deprecation") does not suppress warnings from javadoc
Product: [Eclipse Project] JDT Reporter: Tom Hofmann <eclipse>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Tom Hofmann CLA 2005-05-10 09:55:48 EDT
I20050509-2000 (M7 test pass)

- have this setup:

-------- Deprecation.java ----------
package m7testing;


/**
 * @since 3.1
 */
public class Deprecation {
	/**
	 * comment
	 */
	@Deprecated
	public void foo() {}
}

-------- SubDeprecation.java ---------
package m7testing;


/**
 * @since 3.1
 */
@SuppressWarnings("deprecation")
public class SubDeprecation extends Deprecation {
	/**
	 * @see m7testing.Deprecation#foo()
	 */
	@Override
	public void foo() {
		// TODO Auto-generated method stub
		super.foo();
	}
}
-----------------------------

> expected: no deprecation warnings in SubDeprecation, as the entire class is
marked with SuppressWarnings
< actual: the reference in code to super.foo is not flagged, however, the
reference in javadoc is flagged as warning.
Comment 1 Tom Hofmann CLA 2005-05-10 10:00:59 EDT
Perhaps we should consider letting a @SuppressWarning annotation on a method
also span the corresponding comment?

Example: the following annotation only suppresses the one in code, but not the
reference in the javadoc. Not sure if this is due to this bug, or due to the
fact that the annotation comes after the comment.

public class SubDeprecation extends Deprecation {
	/**
	 * @see m7testing.Deprecation#foo()
	 */
	@Override
	@SuppressWarnings("deprecation")
	public void foo() {
		// TODO Auto-generated method stub
		super.foo();
	}
}
Comment 2 Philipe Mulet CLA 2005-05-10 15:27:33 EDT
Normally @SuppressWarnings should span over entire declaration source range,
i.e. including leading javadoc.

However, there seems to be a bug wrt to deprecation warnings. Will investigate.
Comment 3 Philipe Mulet CLA 2005-05-12 17:33:32 EDT
Deprecated Javadoc problem IDs were not bound to deprecated irritant and thus
not recognized properly by @SuppressWarnings("deprecation").

Added AnnotationTest#test142
Fixed
Comment 4 Philipe Mulet CLA 2005-05-12 19:09:42 EDT
fixed
Comment 5 Olivier Thomann CLA 2005-05-13 10:35:53 EDT
Verified in I20050513-0010.