Bug 96220 - "aspect extends" and "declare parents" does not support ginaric
Summary: "aspect extends" and "declare parents" does not support ginaric
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M2   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 1.5.0 M3   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-21 08:11 EDT by Ping Zheng CLA
Modified: 2005-08-19 15:26 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ping Zheng CLA 2005-05-21 08:11:48 EDT
1)the first problem:
public aspect SuperAspect<T,S>{
    ......
}
this SuperAspect can be compiled successfully, but i can not write any of its 
subaspect :

public aspect SubAspect extends SuperAspect<String,String>{
}
That means the SubAspect can not be compiled, the message is :

Message: NullPointerException thrown: null
Stack trace: java.lang.NullPointerException
	at 
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope.detectHierarchyC
ycle(ClassScope.java:928)
	at 
org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReferen
ce.internalResolveType(ParameterizedSingleTypeReference.java:145)
	at 
org.aspectj.org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReferen
ce.resolveType(ParameterizedSingleTypeReference.java:214)
......

2)The second problem:
public interface TheInterface<T>{
   ...
}
public class AnotherClass{}

The problem is: The following code can not be compiled:
public aspect SomeAspect{
    declare parents: AnotherClass implements TheInterface<String>;
    ...
}
Comment 1 Andrew Clement CLA 2005-05-21 11:22:01 EDT
Bug (1) has already been fixed in CVS.  We have not yet made the fix available
in a dev build.
Comment 2 Andrew Clement CLA 2005-05-21 11:22:15 EDT
target m3
Comment 3 Andrew Clement CLA 2005-05-25 13:33:57 EDT
let me take a look at this..
Comment 4 Andrew Clement CLA 2005-05-25 15:49:04 EDT
public aspect SubAspect extends SuperAspect<String,String>{}

this is actually illegal because you can only sub-type an abstract aspect - and
you should get an error message.  However, if you do make SuperAspect abstract
then it will still fail to compile due to us attempting to locate the the type
'SuperAspect<String,String>' when we should be looking for simply 'SuperAspect'.
 This is simple to fix.

I initially hoped the declare parents problem was in our PatternParser code -
which wouldn't be too tough to fix.  But I think it might be in the up front
parser which makes it a little messier...
Comment 5 Samuel Gélineau CLA 2005-06-30 11:06:51 EDT
*** Bug 98592 has been marked as a duplicate of this bug. ***
Comment 6 Samuel Gélineau CLA 2005-08-10 11:50:02 EDT
oops, Bug 98592  not a duplicate at all! my bad.
Comment 7 Adrian Colyer CLA 2005-08-19 15:26:42 EDT
declare parents is now fully operational with parameterized types.

Declaring generic abstract aspects and extending them is also fixed, in the M3 build use of type variables 
within pointcuts, declare statements and itds will lead to errors (mostly UnsupportedOperationExceptions). 
In M4 this implementation will be completed. Use type variables for methods, fields etc. is fully working.