1

我正在使用@DeclareMixinaspectjrt-1.6.11.

情况是:

    @Aspect
    public class anAspect {

      @DeclareMixin(value="@an.annotation.package.* *", interfaces = {
        FirstInterface.class, SecondInterface.class, ThirdInterface.class
      })
      public AggregateInterface magicMethod(Object instance) {
        return new AggregateInterfaceImpl(instance);
      }

      public interface AggregateInterface extends FirstInterface, 
        SecondInterface, ThirdInterface {
      }
}

所以当我通过编译时aspectj-maven-plugin-1.4,编译器说工厂方法(在我的例子中是magicMethod())不会返回实现任何已实现接口的东西。

当我在AggregateInterfaceImpl.

你对这个问题有任何想法吗?是不是我做错了什么?

谢谢。

4

1 回答 1

0

I've resolved this issue declaring different mixins attached to different factory methods.

于 2013-04-24T08:42:17.663 回答