diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-09-11 13:30:27 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-09-11 13:30:55 +0200 |
commit | 01e4d872465235a0a504dbd5119d6e5b0ad3403c (patch) | |
tree | 56716ae7870da580b9c48fe7333c2475274b2bae /sonar-maven-plugin | |
parent | 49bc20e4cd664c5f373f8d451bf636d1d880bf81 (diff) | |
download | sonarqube-01e4d872465235a0a504dbd5119d6e5b0ad3403c.tar.gz sonarqube-01e4d872465235a0a504dbd5119d6e5b0ad3403c.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-maven-plugin')
-rw-r--r-- | sonar-maven-plugin/src/main/java/org/sonar/maven/SonarMojo.java | 8 |
1 files changed, 4 insertions, 4 deletions
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<Dependency> stack = new Stack<SonarMojo.Dependency>(); + private Deque<Dependency> stack = new ArrayDeque<SonarMojo.Dependency>(); 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); |