Details
Description
The Maven Findbugs plugin generates two XML reports in the target/ directory : findbugs.xml and findbugsXml.xml. The first one is the findbugs xdocs report used to generate the Maven site, and the second one is the "real" findbugs XML report.
In some case some violations are missing in the findbugs xdocs report which is used by Sonar. Looks like this happens with related violations. For instance, in the following case, the first primary (primary='true') violation will be in the findbugs.xml file but not the secondary (role='SOURCE_LINE_ANOTHER_INSTANCE) violation :
<SourceLine endBytecode='111' startBytecode='111' start='240' classname='com.bnpparibas.cib.zgh.client.swing.historic.HistoricDialog$ChercheAction' primary='true' sourcepath='com/bnpparibas/cib/zgh/client/swing/historic/HistoricDialog.java' sourcefile='HistoricDialog.java' end='240'><Message>At HistoricDialog.java:[line 240]</Message></SourceLine>
<SourceLine endBytecode='159' startBytecode='159' start='244' classname='com.bnpparibas.cib.zgh.client.swing.historic.HistoricDialog$ChercheAction' sourcepath='com/bnpparibas/cib/zgh/client/swing/historic/HistoricDialog.java' role='SOURCE_LINE_ANOTHER_INSTANCE' sourcefile='HistoricDialog.java' end='244'><Message>Another occurrence at HistoricDialog.java:[line 244]</Message></SourceLine>
Example of a BugInstance node in the findbugsXml.xml report file :
A BugInstance node can contain several SourceLine nodes.