Community
Participate
Working Groups
Currently DeclarePrecedence has one String property. This makes it impossible to declare multiple precedence rules in an aspect. A simple, backward compatible fix is to modify the property type to String[] with each element representing a precedence rule.
Can you give an example of what you are trying to do?
Here is what I was trying to do (using the change I suggest): @Aspect @DeclarePrecedence({"AuthenticationAspect, AuthorizationAspect", "PoolingAspect, LoggingAspect"}) class SystemCoordinator { } Generally, I try to follow the pattern (as recommended in AJIA), where the "regular" aspect themselves do no declare any precedence rules (that would cause code-tangling experienced in now-unsupported "dominates" construct). Instead, I write another "co-ordinating" aspect that specifies the precedence rules for aspects in my system. Part of the issue is simply asymmetry between the code-style and @AspectJ syntax. In code-style, one aspect can include any number of precedence declaration. So the same thing should be possible with @AspectJ.
Also as you have shown by having multiple statements you can be very specific about precedence e.g. there is no rule for Authentication and Pooling which could of cause be declare elsewhere.
I thought I should be explicit that after modifying the value attribute's type from String to String[] the current code will continue to compile without any modifications (i.e. no need to supply extra parentheses around the string value).
unsetting the target field which is currently set for something already released