From 811f85c12744c670b728565ee0882abc94c53009 Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Fri, 19 Apr 2013 18:45:40 -0400 Subject: [PATCH] Updated to accomadate removing dependencies (used by the DependencyBundlingAnalyzer) Former-commit-id: 3719925f410094d04d5276e118c48f6733d15a17 --- src/main/java/org/owasp/dependencycheck/Engine.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/owasp/dependencycheck/Engine.java b/src/main/java/org/owasp/dependencycheck/Engine.java index b1413b1ce..0e7de2034 100644 --- a/src/main/java/org/owasp/dependencycheck/Engine.java +++ b/src/main/java/org/owasp/dependencycheck/Engine.java @@ -209,10 +209,16 @@ public class Engine { final List analyzerList = analyzers.get(phase); for (Analyzer a : analyzerList) { - for (Dependency d : dependencies) { + Iterator itrDependencies = dependencies.iterator(); + while (itrDependencies.hasNext()) { + Dependency d = itrDependencies.next(); if (a.supportsExtension(d.getFileExtension())) { try { a.analyze(d, this); + //the following is mainly to deal with the DependencyBundlingAnalyzer + if (a.getPostAnalysisAction() == Analyzer.PostAnalysisAction.REMOVE_JAR) { + itrDependencies.remove(); + } } catch (AnalysisException ex) { d.addAnalysisException(ex); }