Community
Participate
Working Groups
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
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
Ok, I found it: This is AspectJ 1.6.11.RC1
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.