Correctly apply weightings when searching for CPEs

This commit is contained in:
Michal Srb
2016-06-14 21:34:04 +02:00
parent c34dc97bd4
commit a2309e1c2e
2 changed files with 3 additions and 3 deletions

View File

@@ -198,8 +198,8 @@ public class CPEAnalyzer implements Analyzer {
LOGGER.debug("product search: {}", products);
}
if (!vendors.isEmpty() && !products.isEmpty()) {
final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(),
dependency.getVendorEvidence().getWeighting());
final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getVendorEvidence().getWeighting(),
dependency.getProductEvidence().getWeighting());
if (entries == null) {
continue;
}

View File

@@ -240,7 +240,7 @@ public class CPEAnalyzerIntegrationTest extends BaseDBTestCase {
Set<String> vendorWeightings = Collections.singleton("apache");
List<IndexEntry> result = instance.searchCPE(vendor, product, productWeightings, vendorWeightings);
List<IndexEntry> result = instance.searchCPE(vendor, product, vendorWeightings, productWeightings);
instance.close();
boolean found = false;