Eliminate the use of java.util.Stack 85/8685/2
authorRobert Varga <rovarga@cisco.com>
Sun, 13 Jul 2014 15:41:14 +0000 (17:41 +0200)
committerRobert Varga <rovarga@cisco.com>
Sun, 13 Jul 2014 15:41:14 +0000 (17:41 +0200)
It is a synchronized entity, which we use in contexts which are limited
to a single thread. Use Deque<> for interfaces and a combination of
LinkedList implementation.

Signed-off-by: Robert Varga <rovarga@cisco.com>
Change-Id: I76956d52ee7ebb332267b0c13bb129aa9974b884

yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/NodeUtilsTest.java

index f243f7183ca7ba359e9e2bf162c358e76329210d..eeac30bf99d704e220db41c12a98dda0bb279fdf 100644 (file)
@@ -12,7 +12,8 @@ import java.net.URI;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
-import java.util.Stack;
+import java.util.Deque;
+import java.util.LinkedList;
 
 import org.junit.Assert;
 import org.junit.Before;
@@ -145,7 +146,7 @@ public class NodeUtilsTest {
     }
 
     private static void checkFamilyBinding(final CompositeNode treeRoot) throws Exception {
-        Stack<CompositeNode> jobQueue = new Stack<>();
+        Deque<CompositeNode> jobQueue = new LinkedList<>();
         jobQueue.push(treeRoot);
 
         while (!jobQueue.isEmpty()) {