Community
Participate
Working Groups
Per (doc/adk15notebook/ataspectj-itds.html) documentation: "If the interface defines one or more operations, and these are not implemented by the target type, an error will be issued during weaving.". However, if I use @DeclareParents with a non-marker interface targeted to a class that already includes the needed implementation, the compiler produces an incorrect error ("@DeclareParents: used with a non marker interface and no defaultImpl="..." ). Here is example setup: // NonMarkerInterface.java package test; public interface NonMarkerInterface { public void something(); } // ClassThatAlreadyIncludeRequiredMethods.java package test; public class ClassThatAlreadyIncludeRequiredMethods { public void something() { } } // DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods.java package test; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.DeclareParents; @Aspect public class DeclareParentsForNonMarkerInterfaceToAClassThatAlreadyIncludeRequiredMethods { @DeclareParents("test.ClassThatAlreadyIncludeRequiredMethods") public NonMarkerInterface nmi; }
ramnivas - are these impacting spring users?
(In reply to comment #1) > ramnivas - are these impacting spring users? > I believe I first saw it in a Spring project.
This is a bit of a change to the current implementation which polices everything up front with the simple rule 'does the interface have methods? if it does, the default impl must be specified'. Switching things around to support this feature is a question of moving that check to weave time from compile time and then for each type that matches the pattern we have to check if it implements the methods as specified on the interface. I've implemented it and tried it, and it does work OK. Changes committed - there may be issues with visibility of the implementing methods and any use of covariance might cause a problem - but the basics are in.