reduce xerces dependency

Change-Id: If7401abf4d7c460fd53174198d7ba9147ed83f67
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1293
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Michael Blow <mblow@apache.org>
Tested-by: Michael Blow <mblow@apache.org>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-lang-aql/pom.xml b/asterixdb/asterix-lang-aql/pom.xml
index 188436e..b80c232 100644
--- a/asterixdb/asterix-lang-aql/pom.xml
+++ b/asterixdb/asterix-lang-aql/pom.xml
@@ -128,10 +128,6 @@
       <artifactId>asterix-lang-common</artifactId>
       <version>${project.version}</version>
     </dependency>
-    <dependency>
-      <groupId>xerces</groupId>
-      <artifactId>xercesImpl</artifactId>
-    </dependency>
   </dependencies>
 
 </project>
diff --git a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
index 0a9079d..d17861e 100644
--- a/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
+++ b/asterixdb/asterix-lang-aql/src/main/javacc/AQL.jj
@@ -11,7 +11,7 @@
 package org.apache.asterix.lang.aql.parser;
 
 // For AQLParserTokenManager
-import org.apache.xerces.util.IntStack;
+import java.util.ArrayDeque;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -2563,7 +2563,7 @@
 TOKEN_MGR_DECLS:
 {
     public int commentDepth = 0;
-    public IntStack lexerStateStack = new IntStack();
+    public ArrayDeque<Integer> lexerStateStack = new ArrayDeque<Integer>();
 
     public void pushState() {
       lexerStateStack.push( curLexState );
diff --git a/asterixdb/asterix-lang-sqlpp/pom.xml b/asterixdb/asterix-lang-sqlpp/pom.xml
index a821c1c..bce61d5 100644
--- a/asterixdb/asterix-lang-sqlpp/pom.xml
+++ b/asterixdb/asterix-lang-sqlpp/pom.xml
@@ -125,10 +125,6 @@
       <artifactId>asterix-lang-common</artifactId>
       <version>${project.version}</version>
     </dependency>
-    <dependency>
-      <groupId>xerces</groupId>
-      <artifactId>xercesImpl</artifactId>
-    </dependency>
   </dependencies>
 
 </project>
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index f113894..bcbdd26 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -11,7 +11,7 @@
 package org.apache.asterix.lang.sqlpp.parser;
 
 // For SQL++ ParserTokenManager
-import org.apache.xerces.util.IntStack;
+import java.util.ArrayDeque;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -3024,7 +3024,7 @@
 TOKEN_MGR_DECLS:
 {
     public int commentDepth = 0;
-    public IntStack lexerStateStack = new IntStack();
+    public ArrayDeque<Integer> lexerStateStack = new ArrayDeque<Integer>();
 
     public void pushState() {
       lexerStateStack.push( curLexState );
diff --git a/asterixdb/asterix-yarn/pom.xml b/asterixdb/asterix-yarn/pom.xml
index 79b9822..720353d 100644
--- a/asterixdb/asterix-yarn/pom.xml
+++ b/asterixdb/asterix-yarn/pom.xml
@@ -233,6 +233,11 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>xerces</groupId>
+      <artifactId>xercesImpl</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-minicluster</artifactId>
       <version>${hadoop.version}</version>