Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Unnecessary perthis fields when using inter type declarations

I wonder how much effort it would be to change this. Eventually, of course, the annotations are determined when adding the method, in BcelTypeMunger. But it is quite complex and involes a few private methods. Do you think it would be possible to move the annotation collecting to the creation of the NewMethodTypeMunger, so that HasMemberTypePatternForPerThisMatching can access them? Would it somehow fit into the architecture?

You could probably flesh out that pessimistic approach to dig a little more into annotations.  I presume in your case you *do* have ITDs in the mix as well as perthis? I’m not sure I’d move the annotation collecting stuff as that may be disturbing things too much but doing an additional quick annotation search in the HasMemberTypePatternForPerThisMatching type when ITDs are around doesn’t sound too unpleasant. It just wasn’t needed for that initial use case.

But that is just my first thought after spending just a few minutes looking at it.

cheers,
Andy



On Oct 31, 2014, at 6:51 AM, Melcher. Jan Philipp <JanPhilipp.Melcher@xxxxxxx> wrote:

Hi,
 
This is a follow-up to the bug report "perthis inserts perObjectField to all compiled classes” [1] which was fixed in 2011 [2].
 
The class HasMemberTypePatternForPerThisMatching [1] implements a pessimistic heuristic when a perthis pointcut could possibly match a type. It works well in all but one context that is already described as a comment in the file: ITDs. The comment claims that it is not possible to determine whether an added method matches the pointcut because the annotations cannot be retrieved. I guess this is still true because neither NewMethodTypeMunger itself nor the methods that create instances of it add annotations.
 
I wonder how much effort it would be to change this. Eventually, of course, the annotations are determined when adding the method, in BcelTypeMunger. But it is quite complex and involes a few private methods. Do you think it would be possible to move the annotation collecting to the creation of the NewMethodTypeMunger, so that HasMemberTypePatternForPerThisMatching can access them? Would it somehow fit into the architecture?
 
We’d really like to get rid of unnecessary fields introduced by the perthis() aspects, but I don’t want to waste time breaking the whole architecture just to fix this issue.
 
Thanks!
Jan
 
 
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-dev


Back to the top