You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2017/12/17 22:42:12 UTC

svn commit: r1818520 - /axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java

Author: veithen
Date: Sun Dec 17 22:42:11 2017
New Revision: 1818520

URL: http://svn.apache.org/viewvc?rev=1818520&view=rev
Log:
Use generics.

Modified:
    axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java

Modified: axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java?rev=1818520&r1=1818519&r2=1818520&view=diff
==============================================================================
--- axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java (original)
+++ axis/axis2/java/core/branches/AXIS2-4091/modules/kernel/test/org/apache/axis2/description/WSDL11ToAxisServiceBuilderTest.java Sun Dec 17 22:42:11 2017
@@ -78,19 +78,18 @@ public class WSDL11ToAxisServiceBuilderT
         final String portName = "FooHttpGetPort";
           
         AxisService service = new WSDL11ToAxisServiceBuilder(in, serviceName, portName).populateService();
-        List schemaDocuments = service.getSchema();
-        List duplicatedGlobalElements = findDuplicatedGlobalElements(schemaDocuments);
+        List<XmlSchema> schemaDocuments = service.getSchema();
+        List<QName> duplicatedGlobalElements = findDuplicatedGlobalElements(schemaDocuments);
         // NO duplicated element should exists
         assertTrue("Duplicated global element declarations found in '" +  wsdlPath, 
             duplicatedGlobalElements.isEmpty());
     }
 
-    protected List findDuplicatedGlobalElements(List schemaDocuments) {
-        List duplicatedGlobalElementDeclarations = new ArrayList();
-        Set globalElementDeclarations = new HashSet();
+    protected List<QName> findDuplicatedGlobalElements(List<XmlSchema> schemaDocuments) {
+        List<QName> duplicatedGlobalElementDeclarations = new ArrayList<QName>();
+        Set<QName> globalElementDeclarations = new HashSet<QName>();
         // Iterate over all schema documents
-        for (int i = 0; i < schemaDocuments.size(); i++) {
-            XmlSchema schemaDocument = (XmlSchema)schemaDocuments.get(i);
+        for (XmlSchema schemaDocument : schemaDocuments) {
             for (XmlSchemaObject xmlSchemaObject : schemaDocument.getItems()) {
                 // Check only XML schema elements
                 if (xmlSchemaObject instanceof XmlSchemaElement) {