|Re: [aspectj-users] My declare warning pointcut generates too many duplicate warnings, how to fix it?|
A typical good pointcut has 2 or 3 pieces:
1) a kind (a what)
2) a scope (a where)
3) optionally, some context binding
Your pointcut only has (2), this means without (1) you are getting
lots of messages (it is matching on all the joinpoints within the code
of the method you are matching with withincode). ÂI think you want to
change from withincode to execution. ÂThat will give you a (1) since
execution is a kinded pointcut.
pointcut unauthorizedMethods() :
ÂÂ Âwithin(!@Authorize HttpHandlerType+) &&
ÂÂ Âexecution(@(GET || PUT || POST || DELETE) !@Authorize public * *.*(..));
On 8 December 2011 13:28, Mark <[hidden email]> wrote:_______________________________________________> Sent from the AspectJ - users mailing list archive at Nabble.com.
> Here is the pointcut:
> Âpointcut unauthorizedMethods() :
> Â Âwithin(!@Authorize HttpHandlerType+) &&
> Â Âwithincode(@(GET || PUT || POST || DELETE) !@Authorize public *
> Âdeclare warning : unauthorizedMethods() : "Unauthorized HTTP resource
> It correctly identifies all the methods which are not annotated with the
> @Authorize annotations. But it generates the warning for each and ever
> statement found in the respective method body! So, for three methods I have
> 18 warning!
> I suspect that the problem is with the withincode join point, but I have no
> idea how to fix it.
> View this message in context: http://aspectj.2085585.n4.nabble.com/My-declare-warning-pointcut-generates-too-many-duplicate-warnings-how-to-fix-it-tp4174448p4174448.html
> aspectj-users mailing list
> [hidden email]
aspectj-users mailing list
If you reply to this email, your message will be added to the discussion below:http://aspectj.2085585.n4.nabble.com/My-declare-warning-pointcut-generates-too-many-duplicate-warnings-how-to-fix-it-tp4174448p4174637.html