Reduce the number of problems in schema-service
[aai/schema-service.git] / aai-schema-gen / src / main / java / org / onap / aai / schemagen / genxsd / OxmFileProcessor.java
index 224192a..150bab7 100644 (file)
@@ -31,10 +31,12 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import javax.xml.XMLConstants;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
+
 import org.onap.aai.edges.EdgeIngestor;
 import org.onap.aai.edges.exceptions.EdgeRuleNotFoundException;
 import org.onap.aai.nodes.NodeIngestor;
@@ -49,16 +51,6 @@ import org.w3c.dom.NodeList;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.*;
-
 public abstract class OxmFileProcessor {
 
     public static final String LINE_SEPARATOR = System.getProperty("line.separator");
@@ -79,7 +71,7 @@ public abstract class OxmFileProcessor {
     protected Document doc = null;
     protected String apiVersion = null;
     protected SchemaVersions schemaVersions;
-    protected Map combinedJavaTypes;
+    protected Map<String, Integer> combinedJavaTypes;
     protected String apiVersionFmt = null;
     protected List<String> topLevelPaths = new ArrayList<String>();
     protected HashMap<String, String> generatedJavaType = new HashMap<String, String>();
@@ -306,11 +298,11 @@ public abstract class OxmFileProcessor {
         return null;
     }
 
-    public Map getCombinedJavaTypes() {
+    public Map<String, Integer> getCombinedJavaTypes() {
         return combinedJavaTypes;
     }
 
-    public void setCombinedJavaTypes(Map combinedJavaTypes) {
+    public void setCombinedJavaTypes(Map<String, Integer> combinedJavaTypes) {
         this.combinedJavaTypes = combinedJavaTypes;
     }
 
@@ -486,7 +478,7 @@ public abstract class OxmFileProcessor {
 
         int useElement = -1;
         if (combinedJavaTypes.containsKey(javaTypeName)) {
-            return combineElementList.get((int) combinedJavaTypes.get(javaTypeName));
+            return combineElementList.get(combinedJavaTypes.get(javaTypeName));
         }
         for (int i = 0; i < combineElementList.size(); ++i) {
             javaTypeElement = combineElementList.get(i);