dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyMergingAnalyzer.java
/**
     * Adds the relatedDependency to the dependency's related dependencies.
     *
     * @param dependency the main dependency
     * @param relatedDependency a collection of dependencies to be removed from
     * the main analysis loop, this is the source of dependencies to remove
     * @param dependenciesToRemove a collection of dependencies that will be
     * removed from the main analysis loop, this function adds to this
     * collection
     */
Adds the relatedDependency to the dependency's related dependencies.
@param dependency the main dependency
@param relatedDependency a collection of dependencies to be removed from
the main analysis loop, this is the source of dependencies to remove
@param dependenciesToRemove a collection of dependencies that will be
removed from the main analysis loop, this function adds to this
collection
Adds the relatedDependency to the dependency ' s related dependencies . @param dependency the main dependency @param relatedDependency a collection of dependencies to be removed from the main analysis loop this is the source of dependencies to remove @param dependenciesToRemove a collection of dependencies that will be removed from the main analysis loop this function adds to this collection
private void mergeDependencies(final Dependency dependency, final Dependency relatedDependency, final Set<Dependency> dependenciesToRemove) {
        LOGGER.debug("Merging '{}' into '{}'", relatedDependency.getFilePath(), dependency.getFilePath());
        dependency.addRelatedDependency(relatedDependency);
        dependency.getVendorEvidence().getEvidence().addAll(relatedDependency.getVendorEvidence().getEvidence());
        dependency.getProductEvidence().getEvidence().addAll(relatedDependency.getProductEvidence().getEvidence());
        dependency.getVersionEvidence().getEvidence().addAll(relatedDependency.getVersionEvidence().getEvidence());
        final Iterator<Dependency> i = relatedDependency.getRelatedDependencies().iterator();
        while (i.hasNext()) {
            dependency.addRelatedDependency(i.next());
            i.remove();
        }
        if (dependency.getSha1sum().equals(relatedDependency.getSha1sum())) {
            dependency.addAllProjectReferences(relatedDependency.getProjectReferences());
        }
        dependenciesToRemove.add(relatedDependency);
    }
private void mergeDependencies ( final Dependency dependency , final Dependency relatedDependency , final Set < Dependency > dependenciesToRemove ) { LOGGER . debug ( "Merging '{}' into '{}'" , relatedDependency . getFilePath ( ) , dependency . getFilePath ( ) ) ; dependency . addRelatedDependency ( relatedDependency ) ; dependency . getVendorEvidence ( ) . getEvidence ( ) . addAll ( relatedDependency . getVendorEvidence ( ) . getEvidence ( ) ) ; dependency . getProductEvidence ( ) . getEvidence ( ) . addAll ( relatedDependency . getProductEvidence ( ) . getEvidence ( ) ) ; dependency . getVersionEvidence ( ) . getEvidence ( ) . addAll ( relatedDependency . getVersionEvidence ( ) . getEvidence ( ) ) ; final Iterator < Dependency > i = relatedDependency . getRelatedDependencies ( ) . iterator ( ) ; while ( i . hasNext ( ) ) { dependency . addRelatedDependency ( i . next ( ) ) ; i . remove ( ) ; } if ( dependency . getSha1sum ( ) . equals ( relatedDependency . getSha1sum ( ) ) ) { dependency . addAllProjectReferences ( relatedDependency . getProjectReferences ( ) ) ; } dependenciesToRemove . add ( relatedDependency ) ; }
Adds the relatedDependency to the dependency's related dependencies.
Adds the relatedDependency to the dependency ' s related dependencies .