Using Deque instead of Stack

diff --git a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java
index d9c09cf..abec80c 100644
--- a/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java
+++ b/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java
@@ -27,11 +27,12 @@
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
+import java.util.ArrayDeque;
 import java.util.Collection;
+import java.util.Deque;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Stack;
 
 import javax.xml.XMLConstants;
 import javax.xml.namespace.QName;
@@ -136,7 +137,7 @@
     /**
      * stack to track imports (to prevent recursion)
      */
-    Stack<SchemaKey> stack;
+    Deque<SchemaKey> stack;
     Map<QName, List<TypeReceiver>> unresolvedTypes;
     XmlSchema xsd;
     // the default extension registry
@@ -170,14 +171,14 @@
     }
 
     /**
-     * Return an indication of whether a particular schema is in the working stack of schemas. This function,
+     * Return an indication of whether a particular schema is not in the working stack of schemas. This function,
      * while public, is probably not useful outside of the implementation.
      * 
      * @param pKey schema key
-     * @return true if the schema is in the stack.
+     * @return false if the schema is in the stack.
      */
     public boolean check(SchemaKey pKey) {
-        return stack.indexOf(pKey) == -1;
+        return !stack.contains(pKey);
     }
 
     public ExtensionRegistry getExtReg() {
@@ -270,7 +271,7 @@
      */
     public void init() {
         
-        stack = new Stack<SchemaKey>();
+        stack = new ArrayDeque<SchemaKey>();
         unresolvedTypes = new HashMap<QName, List<TypeReceiver>>();
         extReg = new ExtensionRegistry();
         knownNamespaceMap = new HashMap<String, XmlSchema>();