tags:

views:

13

answers:

1

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.
Is there a way I can name the declared warning so that I can use @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.

+2  A: 

You may use @SuppressAjWarnings annotation with a warning declaration as exemplified below.

declare warning : execution(!@SuppressAjWarnings * *.badMethodName(..)) : 
    "Your warning message.";
ovunccetin