Eclipse: conflicting warnings

Here's the code snippet:

class MyClass {
    private native void foo();
}

For the above, Eclipse (namely, 3.7.0) gives a warning

The foo () method of type MyClass is never used locally

Ok, but when I try to suppress the warning:

class MyClass {
    @SuppressWarnings("unused")
    private native void foo();
}

He complains

Unnecesary @SuppressWarnings ("unused")

So, is there a way to make him stop complaining?

Update

Sorry for the incomplete information - this warning is displayed only in the AspectJ project. As soon as I create a simple Java project and put my class in it, everything works fine.

As far as I understand, AspectJ uses its own compiler, so this warning should be created by it. I use the AspectJ application development plugin:

Version: 2.1.3.e37x-20110628-1900
AspectJ version: 1.6.12.20110613132200
+5
4

Java :

class MyClass {
    private native void foo();
}

, , Unnecessary @SuppressWarnings("unused"):

class MyClass {
    @SuppressWarnings("unused")
    private native void foo();
}

AspectJ The method foo() from the type MyClass is never used locally, , Java. , AspectJ. AspectJ bugzilla.

https://bugs.eclipse.org/bugs/

AspectJ JDT Eclipse 3.3. , , Eclipse 3.3. , Java 7 , AspectJ, , Eclipse 3.7 3.8, JDT-. .

+1

@SuppressWarnings . Eclipse

- unusedArgument, unusedImport, unusedLabel, unusedLocal, unusedPrivate unusedThrown

: @SuppressWarnings, Eclipse

+2

, "...". , java, - , , checkstyle findbugs?

, , .

0

. Eclipse Indigo, .

0

All Articles