Bug 124999 - [generics] Incorrect call to generic inherited method in around advice
Summary: [generics] Incorrect call to generic inherited method in around advice
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-24 08:41 EST by hesse CLA
Modified: 2006-01-26 03:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hesse CLA 2006-01-24 08:41:13 EST
The following case produces a runtime error:

package aj;

public abstract aspect GenericInheritedMethod<T> {

    protected final T getSomething() {
        return null;
    }

}


package aj;

aspect UseInheritedMethod extends GenericInheritedMethod<Integer> {

    // works as expected
    before() : execution(void someMethod()) {
        System.out.println(getSomething());
    }

    // Runtime Error
    void around() : execution(void someMethod()) {
        System.out.println(getSomething());
    }

    public static void main(String[] args) {
        someMethod();
    }

    private static void someMethod() {
    }

}


>java aj.UseInheritedMethod
null
Exception in thread "main" java.lang.NoSuchMethodError: aj.UseInheritedMethod.getSomething()Ljava/lang/Integer;
        at aj.UseInheritedMethod.ajc$inlineAccessMethod$aj_UseInheritedMethod$aj_UseInheritedMethod$getSomething(UseInheritedMethod.aj)
        at aj.UseInheritedMethod.ajc$around$aj_UseInheritedMethod$2$c74e36b7(UseInheritedMethod.aj:12)
        at aj.UseInheritedMethod.someMethod(UseInheritedMethod.aj:1)
        at aj.UseInheritedMethod.main(UseInheritedMethod.aj:16)

The "inlineAccessMethod" should call "getSomething()Ljava/lang/Object;" as the before advice does.
Comment 1 Andrew Clement CLA 2006-01-26 03:36:43 EST
fix for this is checked in and available in the latest dev build.
Comment 2 Andrew Clement CLA 2006-01-26 03:36:55 EST
fixed.