Bug 94308 - [1.5][compiler] @SuppressWarnings("deprecation") does not suppress warnings from javadoc
Summary: [1.5][compiler] @SuppressWarnings("deprecation") does not suppress warnings f...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 09:55 EDT by Tom Hofmann CLA
Modified: 2005-05-13 10:35 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 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.