Community
Participate
Working Groups
I need to have perthis aspect for classes which have annotated methods: @Aspect("perthis(transactional()) public class TransactionalAspect { @Pointcut("execution(@Transactional * * (..))") public void transactional() { } } It is supposed that perObjectField should be created only for classes which have annotated methods, but currently perObjectField is added to each class.
The current implementation is working 'as designed'. But I agree it isn't optimal. I've made the changes to cope with this specific situation (a method execution pointcut that specifies annotations), it is a little ugly because the weaver is not intended to do matching in this way (it usually uses a vague test up front to determine which types might have an aspect, giving them the field, then does more accurate matching later - the extra field is unused when the accurate match actually fails). So 1.6.12 will do a better job here. Do you find the extra field actually breaks something? Or are you just observing that it exists where you don't want it?
(In reply to comment #1) > Do you find the extra field actually breaks something? Or are you just > observing that it exists where you don't want it? Extra fields are added to all objects -> they eat a little bit more space but the main problem is that they make harder to do introspection.