changeset 369:c489256a188b

Replaced legacy java.util.Stack with java.util.Deque. artifacts/trunk@3683 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 16 Jan 2012 10:03:42 +0000
parents 8e18697d99fb
children 203bd78def81
files ChangeLog artifacts-common/src/main/java/de/intevation/artifacts/common/utils/FileTools.java
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jan 16 08:58:53 2012 +0000
+++ b/ChangeLog	Mon Jan 16 10:03:42 2012 +0000
@@ -1,3 +1,8 @@
+2012-01-16	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* artifacts-common/src/main/java/de/intevation/artifacts/common/utils/FileTools.java:
+	  Replaced legacy java.util.Stack with java.util.Deque.
+
 2012-01-16	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java,
--- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/FileTools.java	Mon Jan 16 08:58:53 2012 +0000
+++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/FileTools.java	Mon Jan 16 10:03:42 2012 +0000
@@ -16,7 +16,8 @@
 import java.io.OutputStream;
 import java.nio.channels.FileChannel;
 
-import java.util.Stack;
+import java.util.Deque;
+import java.util.ArrayDeque;
 import java.util.List;
 import java.util.Set;
 import java.util.HashSet;
@@ -64,7 +65,7 @@
         if (file.exists()) {
             return file;
         }
-        Stack<String> parts = new Stack<String>();
+        Deque<String> parts = new ArrayDeque<String>();
         File curr = file;
         while (curr != null) {
             String name = curr.getName();
@@ -232,7 +233,7 @@
 
     public static void walkTree(File root, FileVisitor visitor) {
 
-        Stack<File> stack = new Stack<File>();
+        Deque<File> stack = new ArrayDeque<File>();
 
         stack.push(root);
 
@@ -317,7 +318,7 @@
         }
         else if (file.isDirectory()) {
 
-            Stack<PrefixDir> stack = new Stack<PrefixDir>();
+            Deque<PrefixDir> stack = new ArrayDeque<PrefixDir>();
             stack.push(new PrefixDir(file.getName() + "/", file));
 
             while (!stack.isEmpty()) {

http://dive4elements.wald.intevation.org