Findbugs: Howto ignore Priority 2 and 3 warnings?

谁说胖子不能爱 提交于 2019-12-07 23:38:42

问题


i like to configure Findsbug-Filter to ignore some priority 2 and 3 warnings.

Something like this.

<?xml version="1.0"?>
<FindBugsFilters>
    <Match>      
      <Bug pattern="SBSC_USE_STRINGBUFFER_CONCATENATION,*some more pattern*" />
      <OR>
       <Priority value="2" />
       <Priority value="3" />
      </OR>
    </Match>
</FindBugsFilter>

But this Filter did not work. Do you know the correct configuration?

thanks alot.


回答1:


Each Match is something to filter out. Try splitting the filter in two matches:

<?xml version="1.0"?>
<FindBugsFilters>
    <Match>      
      <Bug pattern="SBSC_USE_STRINGBUFFER_CONCATENATION,*some more pattern*" />
      <Priority value="2" />
    </Match>
    <Match>      
      <Bug pattern="SBSC_USE_STRINGBUFFER_CONCATENATION,*some more pattern*" />
      <Priority value="3" />
    </Match>
</FindBugsFilter>


来源:https://stackoverflow.com/questions/4657336/findbugs-howto-ignore-priority-2-and-3-warnings

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!