Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 319452 - Type references from intertype target type do not count for UI error messages
Summary: Type references from intertype target type do not count for UI error messages
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.1.0   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-09 20:22 EDT by Kris De Volder CLA
Modified: 2010-07-27 01:03 EDT (History)
1 user (show)

See Also:


Attachments
complete example: zipped up project folder contain aspectj project (3.25 KB, application/zip)
2010-07-10 11:21 EDT, Kris De Volder CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.