mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-21 00:29:21 +01:00
Former-commit-id: 1d9275cc6f466beaa18a362515be98bafe9608b3
This commit is contained in:
@@ -88,7 +88,7 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
|
|||||||
removeBadMatches(dependency);
|
removeBadMatches(dependency);
|
||||||
removeWrongVersionMatches(dependency);
|
removeWrongVersionMatches(dependency);
|
||||||
removeSpuriousCPE(dependency);
|
removeSpuriousCPE(dependency);
|
||||||
removeDuplicativePOMEntries(dependency, engine);
|
removeDuplicativeEntriesFromJar(dependency, engine);
|
||||||
addFalseNegativeCPEs(dependency);
|
addFalseNegativeCPEs(dependency);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,8 +338,17 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeDuplicativePOMEntries(Dependency dependency, Engine engine) {
|
/**
|
||||||
if (dependency.getFileName().toLowerCase().endsWith("pom.xml")) {
|
* Removes duplicate entries identified that are contained within JAR files. These occasionally crop up due to POM
|
||||||
|
* entries or other types of files (such as DLLs and EXEs) being contained within the JAR.
|
||||||
|
*
|
||||||
|
* @param dependency the dependency that might be a duplicate
|
||||||
|
* @param engine the engine used to scan all dependencies
|
||||||
|
*/
|
||||||
|
private void removeDuplicativeEntriesFromJar(Dependency dependency, Engine engine) {
|
||||||
|
if (dependency.getFileName().toLowerCase().endsWith("pom.xml")
|
||||||
|
|| dependency.getFileExtension().equals("dll")
|
||||||
|
|| dependency.getFileExtension().equals("exe")) {
|
||||||
String parentPath = dependency.getFilePath().toLowerCase();
|
String parentPath = dependency.getFilePath().toLowerCase();
|
||||||
if (parentPath.contains(".jar")) {
|
if (parentPath.contains(".jar")) {
|
||||||
parentPath = parentPath.substring(0, parentPath.indexOf(".jar") + 4);
|
parentPath = parentPath.substring(0, parentPath.indexOf(".jar") + 4);
|
||||||
|
|||||||
Reference in New Issue
Block a user