Bug 351592 - Internal compiler error when defining a sub-aspect with generics
Summary: Internal compiler error when defining a sub-aspect with generics
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.11   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 critical (vote)
Target Milestone: 1.6.12   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-08 11:29 EDT by Eric Tanter CLA
Modified: 2011-07-11 16:20 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 Eric Tanter CLA 2011-07-08 11:29:17 EDT
Build Identifier: 20110218-0911

Simple caching aspect example, with abstract aspect (using generics).
Produces an AspectJ internal compiler error
see snapshot here:
http://dl.dropbox.com/u/31262753/aj-error.png

Consequence: aspect is not woven


Reproducible: Always

Steps to Reproduce:
take the following aspectJ project:
http://dl.dropbox.com/u/31262753/caching.zip
Comment 1 Eric Tanter CLA 2011-07-08 12:04:44 EDT
I don't know how to obtain the AspectJ version number, but here is the AJDT version I'm using:

  AspectJ Development Tools	2.1.2.e36x-20110307-1000	org.eclipse.ajdt.feature.group
Comment 2 Eric Tanter CLA 2011-07-10 18:51:20 EDT
Ok, I found it: This is AspectJ 1.6.11.RC1
Comment 3 Andrew Clement CLA 2011-07-11 16:14:27 EDT
not related to generics, reducing the aspect to this will also fail:

public  aspect Caching {
        private Map<Integer,Integer> cache = new HashMap<Integer,Integer>();

        Integer around(Integer a): execution(* Fib.calc*(*)) && args(a) {
                if(cache.containsKey(a)){
                        System.out.println("Using cached value for: " + a);
                        return cache.get(a);
                } else {
                        Integer result = proceed(a);
                        cache.put(a, result);
                        return result;
              }
        }
}

It is due to the around advice and the proceed call expecting an Integer but the method returning an int - the boxing conversion isn't setup correctly.  I've fixed it.