From 01e4d872465235a0a504dbd5119d6e5b0ad3403c Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Thu, 11 Sep 2014 13:30:27 +0200 Subject: Fix some quality flaws --- sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sonar-maven-plugin/src/main') diff --git a/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java b/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java index f17d1bf1b28..301ce90d35d 100644 --- a/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java +++ b/sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java @@ -47,10 +47,11 @@ import org.sonar.runner.api.ScanProperties; import java.io.File; import java.io.IOException; +import java.util.ArrayDeque; import java.util.ArrayList; +import java.util.Deque; import java.util.Iterator; import java.util.List; -import java.util.Stack; /** * @goal sonar @@ -232,15 +233,14 @@ public final class SonarMojo extends AbstractMojo { DependencyNodeVisitor visitor = new BuildingDependencyNodeVisitor(new DependencyNodeVisitor() { - private Stack stack = new Stack(); + private Deque stack = new ArrayDeque(); public boolean visit(DependencyNode node) { if (node.getParent() != null && node.getParent() != node) { Dependency dependency = toDependency(node); if (stack.isEmpty()) { result.add(dependency); - } - else { + } else { stack.peek().dependencies().add(dependency); } stack.push(dependency); -- cgit v1.2.3