I use declare error
and declare warning
to enforce some policies; but in some specific cases I would like to get rid of the warning.
@SuppressWarning
?
Else I see a solution but it doesn't satisfy me: define a custom @SuppressXxxPolicyWarning
annotation and use it to restrict the declare warning
pointcut.
You may use @SuppressAjWarnings annotation with a warning declaration as exemplified below.
declare warning : execution(!@SuppressAjWarnings * *.badMethodName(..)) :
"Your warning message.";
精彩评论