开发者

Is it possible to name an AspectJ-declared warning?

开发者 https://www.devze.com 2023-01-22 18:15 出处:网络
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.

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 开发者_JS百科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.


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

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

精彩评论

暂无评论...
验证码 换一张
取 消