Bug 265986 - [ITDs] When parameters of ITD methods are not fully qualified or imported into the target type, there may be an error in the target type
Summary: [ITDs] When parameters of ITD methods are not fully qualified or imported int...
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.6.4   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL: http://dev.eclipse.org/mhonarc/newsLi...
Whiteboard:
Keywords:
Depends on:
Blocks: 265993
  Show dependency tree
 
Reported: 2009-02-24 12:03 EST by Andrew Eisenberg CLA
Modified: 2009-02-24 18:42 EST (History)
0 users

See Also:


Attachments
This is the project that I am using (3.34 KB, application/octet-stream)
2009-02-24 12:47 EST, Andrew Eisenberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Eisenberg CLA 2009-02-24 12:03:16 EST
From the mailing list:

---------------
While playing along with AJDT and AspectJ Inter Type Declarations I came 
across the following annoyance:

When I create an Aspect with an ITD method that returns a custom class 
object (from an included dependency) and declare the necessary import 
statements in my Aspect, those imports are not automatically weaved in. It 
gives me the error "The method ... from the type ... refers to the missing 
type ..." in my client application, without an Eclipse quick fix 
suggestion :|
----------------------------
Comment 1 Andrew Eisenberg CLA 2009-02-24 12:45:13 EST
The first problem I found was that ITD handles always seem to have fully qualified parameter values on the Aspectj side, but on the JDT side, the handles are only fully qualified if they are fully qualified in the text.  Example:

This aspect:
public aspect InterTypeAspect {
	public Log InterTypeAspectInterface.getLogger(List<?> h) {
		return new Log();
	}
}

Has the following handles:
Java:
=ITD Missing Type Problem/src\/main\/aspect<be.cronos.aop.aspects{InterTypeAspect.aj}InterTypeAspect)InterTypeAspectInterface.getLogger)QList\<*>;
AspectJ:
=ITD Missing Type Problem/src\/main\/aspect<be.cronos.aop.aspects{InterTypeAspect.aj}InterTypeAspect)InterTypeAspectInterface.getLogger)Qjava.util.List\<*>;

So, aspectj handles need to change to accommodate this.
Comment 2 Andrew Eisenberg CLA 2009-02-24 12:47:13 EST
Created attachment 126580 [details]
This is the project that I am using

This failing project was provided here:
http://dev.eclipse.org/mhonarc/newsLists/news.eclipse.technology.ajdt/msg01909.html
Comment 3 Andrew Eisenberg CLA 2009-02-24 13:22:45 EST
Fixed and committed with test.  Will be available in next dev build.

Return types were not properly set when creating the mock element that should be ITD-ed into the target tyoe.  The simple type was being used, not the fully qualified type.
Comment 4 Andrew Eisenberg CLA 2009-02-24 18:42:28 EST
fixed.