Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to inject a static field into a multitude of types with AspectJ?

I would agree, *but* private ITD methods onto interfaces currently
still mangle the method name that is introduced.  So you can ITD
getLogger() but that won't be what gets into the interface and type.

This is due to what 'private' means.  If you consider it means
'private to the aspect' then we don't want the type or interface
tripping over it, hence it gets a new name that is unlikely to clash
with anything in the existing types (and code you write in the class
is unlikely to see it, use it).

Now this definition of privacy has been evolving over the last few
releases because it isn't seen as useful, it isn't how users think,
they think they are creating a private method in the target.  I have
addressed the basic case of private ITD method onto a CLASS (that will
now not mangle the name) but the more complex form of an ITD onto an
interface is still mangled.  (there is a bugzilla somewhere about
it...)

cheers,
Andy

On 15 January 2012 23:54, Mark <mark.kharitonov@xxxxxxxxx> wrote:
> Would not you agree that getLogger must be made private? Otherwise, someone
> could have invoked it from an arbitrary context, in which case
> thisEnclosingJoinPointStaticPart would be something unaffected by the
> aspect.
>
>
> --
> View this message in context: http://aspectj.2085585.n4.nabble.com/How-to-inject-a-static-field-into-a-multitude-of-types-with-AspectJ-tp4168355p4298714.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top