Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360943

Summary: Contradicting warnings in AspectJ project.
Product: [Tools] AJDT Reporter: Andy Belsky <andy>
Component: UIAssignee: AJDT-inbox <AJDT-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: aclement, andrew.eisenberg, andy
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Andy Belsky CLA 2011-10-14 07:12:03 EDT
Build Identifier: 

The following class always produces a warning, both with SuppressWarnings or without.

--- MyClass.java ---
class MyClass {
    //@SuppressWarnings("unused")
    private native void foo();
}
--- MyClass.java ---

Reproducible: Always

Steps to Reproduce:
1. Create AspectJ Java project (in simple Java project, this cannot be reproduced).

2. Add class:
--- MyClass.java ---
class MyClass {
    private native void foo();
}
--- MyClass.java ---

2.1. It produces a warning: "The method foo() from the type MyClass is never used locally"

3. Alright, add @SuppressWarnings:

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

3.1. It complains again: Unnecesary @SuppressWarnings("unused")
Comment 1 Andy Belsky CLA 2011-10-14 07:14:21 EDT
My Eclipse build ID is I20110613-1736,

AspectJ plug-in version:

Version: 2.1.3.e37x-20110628-1900
AspectJ version: 1.6.12.20110613132200
Comment 2 Andrew Clement CLA 2011-10-14 15:37:02 EDT
When you add the SuppressWarnings we can see the entry in the problems view goes away.  The error remaining in the editor is a reconciling error - that means this is likely to be an AJDT issue.
Comment 3 Andrew Eisenberg CLA 2012-02-29 19:39:10 EST
Hmm...not able to reproduce this.  For me, the AJ behavior mirrors the Java behavior.  There is no warning when @SuppressWarnings("unused") is commented, and there is a warning when uncommented.

Andy Clement, are you able to reproduce?

Andy Belsky, what version of AJDT are you running?  Have you tried updating to the latest snapshot?
Comment 4 Andrew Clement CLA 2012-03-01 11:17:50 EST
On the latest dev build I don't see the warning about the method being unused when there is no suppression annotation.  it is possible the recent compiler update has slightly changed (fixed) things here.
Comment 5 Andrew Eisenberg CLA 2012-03-01 12:02:57 EST
Thanks for getting back to me on this.