开发者

Is it possible to name an AspectJ-declared 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜