Community
Participate
Working Groups
Build Identifier: AspectJ Compiler 1.6.7 built on Friday Jan 1, 2010 at 03:49:38 GMT I want to use the @DeclareMixin annotation to let a predefined bean class implement the following interface: public interface Rateable { @Action("rating") public void doRating(@Binding("value") int value); } The annotations @Action and @Binding are both annotation with RetentionPolicy.RUNTIME which are used by another framework. My aspect-related code looks like this: public class RateableMixin implements Rateable { public void doRating(int value); } @Aspect public class RateableAspect { @DeclareMixin("my.package.MyBean") public static Rateable createMixin() { return new RateableMixin(); } } The code is compiled using the org.codehaus.mojo::aspectj-maven-plugin version 1.3 The result is a bean that really implement Rateable but unfortunatelly the annotations of the parameter disappeared: public MyBean implements Rateable { @Action("rating") public void doRating(int value) { ... } } Unfortunatelly that breaks my code. The framework I am using expects that either @Action and @Binding are both located in the implementation or they are both in the interface. (actually I would prefer the latter version). Any workarounds for this? Reproducible: Always Steps to Reproduce: See the code in my 'Details'.
I can't think of a workaround unfortunately. Hopefully i'll get to fixing this soon.
I found a workaround, which solves the issue in my project. I simply switched from Annotation/Java-style to the 'native' AspectJ Language. Then the Method-Annotation is not copied to the 'parent'.
unsetting the target field which is currently set for something already released