I have added the following in the findbugs exclude.xml file
<Match>
<Class name="com.ebay.kernel.service.invocation.SvcInvocationConfig" />
<Method name="getConnectionConfig" />
<Bug pattern="IS2_INCONSISTENT_SYNC" />
</Match>
The code that needs to be ignored
public ConnectionConfig getConnectionConfig() {
return m_connectionConfig;
}
because Findbugs reports that
m_connectionConfig suffers from (inconsistent synchronization) BUG - IS2_INCONSISTENT_SYNC
But for some reason my findbugs are not getting ignored.
and when I do following -
<Match>
<Class name="com.ebay.kernel.service.invocation.SvcInvocationConfig" />
<Bug pattern="IS2_INCONSISTENT_SYNC" />
</Match>
The findbugs is getting ignored for the entire class but as soon as I introduce
<Method name="getConnectionConfig">
tag in between, findbugs stops getting ignored for that method.
Can someone help me figure out why?
The IS2_INCONSISTENT_SYNC
warning is issued on a data member (field), according to its usages by various methods, constructors, static blocks, etc. and not on the method itself, so you can't ignore it with a <Method>
element.
Instead, you could use a <Field>
element:
<Match>
<Class name="com.ebay.kernel.service.invocation.SvcInvocationConfig" />
<Field name="m_connectionConfig" />
<Bug pattern="IS2_INCONSISTENT_SYNC" />
</Match>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With