List<FindbugsXmlReportParser.Violation> fbViolations = reportParser.getViolations();
for (FindbugsXmlReportParser.Violation fbViolation : fbViolations) {
Rule rule = ruleFinder.findByKey(FindbugsConstants.REPOSITORY_KEY, fbViolation.getType());
JavaFile resource = new JavaFile(fbViolation.getSonarJavaFileKey());
if (context.getResource(resource) != null) {
<BUG>Violation violation = new Violation(rule, resource).setLineId(fbViolation.getStart()).setMessage(fbViolation.getLongMessage());
</BUG>
context.saveViolation(violation);
}
}

List<FindbugsXmlReportParser.Violation> fbViolations = reportParser.getViolations();
for (FindbugsXmlReportParser.Violation fbViolation : fbViolations) {
Rule rule = ruleFinder.findByKey(FindbugsConstants.REPOSITORY_KEY, fbViolation.getType());
JavaFile resource = new JavaFile(fbViolation.getSonarJavaFileKey());
if (context.getResource(resource) != null) {
Violation violation = Violation.create(rule, resource).setLineId(fbViolation.getStart()).setMessage(fbViolation.getLongMessage());
context.saveViolation(violation);
