Bug 351592

Summary: Internal compiler error when defining a sub-aspect with generics
Product: [Tools] AspectJ Reporter: Eric Tanter <etanter>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: aclement
Version: 1.6.11   
Target Milestone: 1.6.12   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

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.