How do I turn off findbugs “Redundant nullcheck” in maven?

孤街醉人 提交于 2020-01-14 12:41:45

问题


I can't find the name of the detector that reports the "Redundant nullcheck" (RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE) anyone who knows which it is? Googling just gives me tons of project reports...

I get a lot of errors on it since I use JetBrains @NotNull annotations tool (it inserts null checks into the bytecode).

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>findbugs-maven-plugin</artifactId>
  <version>2.5.2</version>
  <configuration>
    <omitVisitors>???WhatIsTheDetectorsName???</omitVisitors>
  </configuration>
</plugin>

Thanks in advance


回答1:


From the findbugs-maven-plugin usage documentation states that the visitors/omitVisitors options both specify a comma-separated list of bug detectors which should be run/not run. The bug detectors are specified by their class names, without any package qualification.

The class which checks for the redundant null check of non-null value is, as far as I can tell, FindNullDeref. However it does a number of other checks as well, so you would also be turning them off. Not sure if it is possible to turn off just that one check that is bothering you.



来源:https://stackoverflow.com/questions/19213158/how-do-i-turn-off-findbugs-redundant-nullcheck-in-maven

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