@Override
@Transactional(readOnly = false)
public void updateVulnerabilities(Application application) {
List<Vulnerability> vulnerabilities = application.getVulnerabilities();
FindingMatcher matcher = new FindingMatcher(null);
if (vulnerabilities != null) {
for (int i = 0; i < vulnerabilities.size(); i++) {
if (vulnerabilities.get(i).getFindings() != null
&& vulnerabilities.get(i).getFindings().size() > 0) {
Finding finding = vulnerabilities.get(i).getFindings()
.get(0);
for (int j = i + 1; j < vulnerabilities.size(); j++) {
if (matcher.doesMatch(finding, vulnerabilities.get(j))) {
for (Finding vulnFinding : vulnerabilities.get(j)
.getFindings()) {
vulnerabilities.get(i).getFindings()
.add(vulnFinding);