9

I can exclude a regular method like this in my findbugs-exclude.xml:

<Match>
    <Class name="com.my.package.MyClass"/>
    <Method name="calculateSomeValue"/>
    <Bug pattern="CLI_CONSTANT_LIST_INDEX"/>
</Match>

But what if I want to ignore the bug pattern being flagged in a constructor?

I've tried

<Method name="MyClass"/>

and

<Method name="new"/>

which don't seem to work.

MyClass only defines one constructor.

Vivek Chavda
  • 473
  • 1
  • 4
  • 16

1 Answers1

15

You have to use this code for exclude constructor

<Method name="&lt;init&gt;"/>