Summary: | Abstract generic aspect leads to java.lang.ClassFormatError: Duplicate method name&signature in class file | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Johannes Unterstein <unterstein> |
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P2 | CC: | aclement |
Version: | unspecified | ||
Target Milestone: | 1.6.12 | ||
Hardware: | Macintosh | ||
OS: | Mac OS X - Carbon (unsup.) | ||
Whiteboard: |
Description
Johannes Unterstein
2011-06-15 01:51:43 EDT
fixed ,thanks for the testcase. will be in a dev build shortly. Hey there, does the fix can handle with this extended example as well? package info.unterstein.hagen.moderne.ea6.a3; import java.util.HashMap; /** * Enables a more complex and generic caching aspect which can be extended to be * used in several use cases. * * @author <a href="mailto:unterstein@me.com">Johannes Unterstein</a> * @param <k> * the class of the keys * @param <V> * the class of the cached values */ public abstract aspect CacheAspect<K, V> { private HashMap<K, V> cache; public abstract pointcut cachePoint(K key); V around(K key) : cachePoint(key) { if (this.cache == null) { this.cache = new HashMap<K, V>(); } V result; if (this.cache.containsKey(key)) { result = this.cache.get(key); } else { result = proceed(key); this.cache.put(key, result); } return result; } } /** * An extension of the generic cache for the concrete use case of caching the * {@link DataGenerator}. * * @author <a href="mailto:unterstein@me.com">Johannes Unterstein</a> */ public aspect DataGeneratorCacheAspect extends CacheAspect<Integer, Integer> { public pointcut cachePoint(Integer key) : call(Integer DataGenerator.getData(Integer)) && args(key); } Cheers and many thank, Johannes |