tags:

views:

186

answers:

1

HI,

In eclipse, I get the following errors in my project:

The annotation @SuppressWarnings is disallowed for this location

Can you please tell me how can I turn those errors into warnings?

Thank you.

Look like it is a bug in eclipse3.6M5. This is the code which gives me error. But it works fine in eclipse3.6M4.

package java.lang.annotation;

/**
 * Defines a meta-annotation for indicating that an annotation is automatically
 * inherited.
 *
 * @since 1.5
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.ANNOTATION_TYPE)
public @interface Inherited {
}
+1  A: 

If it's really a wrong location of the @SuppressWarnings then there is not much you can do. But why should you turn that off?

As any annotation you can use @SuppressWarnings only in front of a class, a variable declaration, a parameter or a method declaration. All other locations will give you a compile error.

tangens