Community
Participate
Working Groups
This bug is to cover any fixes that need putting in to bring these more into line, plus any changes required to the doc to indicate that they don't have identical semantics. One is using a mixin style because the type system cannot be manipulated like it can with code style aspects that require use of ajc for compilation. See the thread by Larry Chu: http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg09516.html Most recently he wrote: --- To follow up, I found these references in the archive about the same topic. http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg07722.html http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg05884.html I found a question posted here that interested me but was never answered: http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg05884.html > The short question is: > When using @DeclareParents to define a mixin, how do I gain access to > the instrumented object from within the mixin object? I was hoping someone might be able to answer this previously asked question. ---
just adding a target so this doesn't completely drop off the radar - but it may not make 1.6.2
related bug 242383
@DeclareParents does not offer the same semantics as code style declare parents, it is just a mixin. I've started to update the documentation to say so: http://www.eclipse.org/aspectj/doc/released/adk15notebook/ataspectj-itds.html @DeclareMixin has been created as the proper mixin strategy to use, it overcomes some of the shortcomings of @DeclareParents and makes it more apparent that it is not intended to be an annotation style replacement for code style declare parents. @DeclareMixin is documented on that same page. > The short question is: > When using @DeclareParents to define a mixin, how do I gain access to > the instrumented object from within the mixin object? @DeclareMixin makes this possible by being an annotation that is attached to the factory method that creates the delegate objects - this factory method can be defined to take a parameter, and when it does the parameter value will be the object instance for which a delegate is sought. For example: @DeclareMixin("Foo") public static MixinInterface createImplementation(Object fooInstance) { return new MixinImplementation(fooInstance); } I have not yet decided whether to fully deprecate @DeclareParents.
unsetting the target field which is currently set for something already released