mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-18 23:34:15 +01:00
Merge pull request #516 from msrb/weightings-bug
Correctly apply weightings when searching for CPEs
This commit is contained in:
@@ -198,8 +198,8 @@ public class CPEAnalyzer implements Analyzer {
|
|||||||
LOGGER.debug("product search: {}", products);
|
LOGGER.debug("product search: {}", products);
|
||||||
}
|
}
|
||||||
if (!vendors.isEmpty() && !products.isEmpty()) {
|
if (!vendors.isEmpty() && !products.isEmpty()) {
|
||||||
final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getProductEvidence().getWeighting(),
|
final List<IndexEntry> entries = searchCPE(vendors, products, dependency.getVendorEvidence().getWeighting(),
|
||||||
dependency.getVendorEvidence().getWeighting());
|
dependency.getProductEvidence().getWeighting());
|
||||||
if (entries == null) {
|
if (entries == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ public class CPEAnalyzerIntegrationTest extends BaseDBTestCase {
|
|||||||
|
|
||||||
Set<String> vendorWeightings = Collections.singleton("apache");
|
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();
|
instance.close();
|
||||||
|
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user