From 500eff0b5f242d9481329a9bde126a7e1c29ed6f Mon Sep 17 00:00:00 2001 From: Hans Joachim Desserud Date: Sat, 2 Nov 2013 19:26:35 +0100 Subject: Fixes a couple of issues by using interfaces rather than a specific implementation --- .../main/java/org/sonar/duplications/detector/suffixtree/Search.java | 2 +- .../src/main/java/org/sonar/duplications/token/TokenQueue.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'sonar-duplications/src/main/java') diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java index 4966607d700..4b24446d133 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java @@ -63,7 +63,7 @@ public final class Search { * Depth-first search (DFS). */ private void dfs() { - LinkedList stack = Lists.newLinkedList(); + Deque stack = Lists.newLinkedList(); stack.add(tree.getRootNode()); while (!stack.isEmpty()) { Node node = stack.removeLast(); diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/token/TokenQueue.java b/sonar-duplications/src/main/java/org/sonar/duplications/token/TokenQueue.java index 842babbe64e..94aa4f522df 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/token/TokenQueue.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/token/TokenQueue.java @@ -19,6 +19,7 @@ */ package org.sonar.duplications.token; +import java.util.Deque; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -26,7 +27,7 @@ import java.util.ListIterator; public class TokenQueue implements Iterable { - private final LinkedList tokenQueue; + private final Deque tokenQueue; public TokenQueue(List tokenList) { tokenQueue = new LinkedList(tokenList); -- cgit v1.2.3