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

Bug 319452

Summary: Type references from intertype target type do not count for UI error messages
Product: [Tools] AJDT Reporter: Kris De Volder <kdevolder>
Component: UIAssignee: AJDT-inbox <AJDT-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aclement
Version: 2.0.2   
Target Milestone: 2.1.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
complete example: zipped up project folder contain aspectj project none

Description Kris De Volder CLA 2010-07-09 20:22:23 EDT
example:
---
package aspects;

import classes.MyClass;

public aspect MyAspect {

    public MyClass.method() {
    }

}
---
Lacking any other references to the MyClass class from MyAspect, the import will be reported as an unused import.

Also, for some reason I will not be allowed to perform a "push in" refactoring on this example because of this error (event though it is only a warning).
Comment 1 Andrew Clement CLA 2010-07-09 22:57:11 EDT
hmmm, I don't get a warning on the import - but I did have to fix that code so the method had a return value...
Comment 2 Kris De Volder CLA 2010-07-10 11:19:25 EDT
(In reply to comment #1)
> hmmm, I don't get a warning on the import - but I did have to fix that code so
> the method had a return value...

Hmm... I guess that's what happens when typing examples from memory rather than actually typing them out inside AJDT.

I'm attaching a zipped up project folder with a complete and correct example. I am getting the import warning on the MyAspect aspect there.
Comment 3 Kris De Volder CLA 2010-07-10 11:21:20 EDT
Created attachment 173937 [details]
complete example: zipped up project folder contain aspectj project
Comment 4 Kris De Volder CLA 2010-07-10 11:35:53 EDT
Some further remarks:

 - the warning only appears in the editor, not in the "problems" view.
 - when I do organize imports, I get an error message that the file contains "parse errors" and we can't organize imports (which is probably better than deleting the "unused" import here :-).
Comment 5 Andrew Eisenberg CLA 2010-07-14 19:22:01 EDT
Fixed locally on 36 branch.  Now, this warning no longer occurs.  Waiting to commit.
Comment 6 Andrew Eisenberg CLA 2010-07-19 12:04:09 EDT
Committed.  Waiting for snapshot build to complete.