cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1228499 [3/4] - in /cxf/trunk: integration/jca/src/main/java/org/apache/cxf/jca/core/resourceadapter/ integration/jca/src/main/java/org/apache/cxf/jca/cxf/ integration/jca/src/main/java/org/apache/cxf/jca/cxf/handlers/ integration/jca/src/...
Date Fri, 06 Jan 2012 23:24:38 GMT
Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlRoot.java Fri Jan  6 23:24:33 2012
@@ -22,19 +22,18 @@ package org.apache.cxf.tools.corba.commo
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
 
 public final class IdlRoot extends IdlScopeBase {
-    private Map<Object, Object> primitiveTypes;
-    private List<Object> includeList;
+    private Map<String, IdlType> primitiveTypes;
+    private List<String> includeList;
 
     private IdlRoot() {
         super(null, "");
-        primitiveTypes = new HashMap<Object, Object>();
-        includeList = new ArrayList<Object>();
+        primitiveTypes = new HashMap<String, IdlType>();
+        includeList = new ArrayList<String>();
 
         for (short i = IdlPrimitive.MINIMUM; i <= IdlPrimitive.MAXIMUM; ++i) {
             IdlPrimitive prim = IdlPrimitive.create(this, i);
@@ -77,10 +76,7 @@ public final class IdlRoot extends IdlSc
 
     public void write(PrintWriter pw) {
         //Write the Include files
-        Iterator it = includeList.iterator();
-
-        while (it.hasNext()) {
-            String s = (String)it.next();
+        for (String s : includeList) {
             pw.println("#include " + s);
         }
 

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopeBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopeBase.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopeBase.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlScopeBase.java Fri Jan  6 23:24:33 2012
@@ -21,7 +21,6 @@ package org.apache.cxf.tools.corba.commo
 
 import java.io.PrintWriter;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Stack;
@@ -29,15 +28,15 @@ import java.util.Vector;
 
 
 public abstract class IdlScopeBase extends IdlDefnImplBase {
-    private List<Object> defns;
-    private Stack<Object> hold;
-    private List<Object> park;
+    private List<IdlDefn> defns;
+    private Stack<IdlDefn> hold;
+    private List<IdlDefn> park;
 
     protected IdlScopeBase(IdlScopeBase parent, String name) {
         super(parent, name);
-        defns = new Vector<Object>();
-        hold = new Stack<Object>();
-        park = new Vector<Object>();
+        defns = new Vector<IdlDefn>();
+        hold = new Stack<IdlDefn>();
+        park = new Vector<IdlDefn>();
     }
 
     public IdlDefn addToScope(IdlDefn def) {
@@ -80,10 +79,7 @@ public abstract class IdlScopeBase exten
 
     public IdlDefn lookup(String nm, boolean undefined) {
         IdlDefn result = null;
-        Iterator it = park.iterator();       
-
-        while (it.hasNext()) {
-            IdlDefn nextDef = (IdlDefn)it.next();
+        for (IdlDefn nextDef : park) {
             if (nextDef.localName().equals(nm)) {
                 result = nextDef;
                 break;
@@ -91,10 +87,7 @@ public abstract class IdlScopeBase exten
         }
 
         if (result == null) {
-            it = hold.iterator();      
-
-            while (it.hasNext()) {
-                IdlDefn nextDef = (IdlDefn)it.next();
+            for (IdlDefn nextDef : hold) {
                 if (nextDef.localName().equals(nm)) {
                     result = nextDef;
                     break;
@@ -106,10 +99,7 @@ public abstract class IdlScopeBase exten
             return result;
         }
         
-        it = defns.iterator();
-
-        while (it.hasNext()) {
-            IdlDefn nextDef = (IdlDefn)it.next();
+        for (IdlDefn nextDef : defns) {
             if (nextDef.localName().equals(nm)) {
                 result = nextDef;
                 break;
@@ -188,9 +178,7 @@ public abstract class IdlScopeBase exten
         }
         doneDefn.add(this);
 
-        Iterator it = definitions().iterator();
-        while (it.hasNext()) {
-            IdlDefn defn = (IdlDefn)it.next();
+        for (IdlDefn defn : definitions()) {
             IdlScopeBase circularScope = defn.getCircularScope(startScope, doneDefn);
             if (circularScope != null) {
                 return circularScope;
@@ -203,20 +191,17 @@ public abstract class IdlScopeBase exten
 
 
     public void write(PrintWriter pw) {
-        Iterator it = defns.iterator();
-
-        while (it.hasNext()) {
-            IdlDefn defn = (IdlDefn)it.next();
+        for (IdlDefn defn : defns) {
             defn.write(pw);
         }
     }
 
 
     public void writeFwd(PrintWriter pw) {
-        ListIterator it = defns.listIterator(defns.size());
+        ListIterator<IdlDefn> it = defns.listIterator(defns.size());
 
         while (it.hasPrevious()) {
-            IdlDefn defn = (IdlDefn)it.previous();
+            IdlDefn defn = it.previous();
             defn.writeFwd(pw);
         }
     }
@@ -224,25 +209,19 @@ public abstract class IdlScopeBase exten
 
     public void flush() {
         promoteParkedToScope();
-        
-        Iterator it = definitions().iterator();
-        while (it.hasNext()) {
-            IdlDefn defn = (IdlDefn)it.next();
+        for (IdlDefn defn : definitions()) {
             defn.flush();
         }
     }
 
 
-    protected Collection definitions() {
+    protected Collection<IdlDefn> definitions() {
         return defns;
     }
 
 
     private void promoteParkedToScope() {
-        Iterator it = park.iterator();
-
-        while (it.hasNext()) {
-            IdlDefn nextDef = (IdlDefn)it.next();
+        for (IdlDefn nextDef : park) {
             defns.add(nextDef);
         }
 

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlStructBase.java Fri Jan  6 23:24:33 2012
@@ -21,7 +21,6 @@ package org.apache.cxf.tools.corba.commo
 
 
 import java.io.PrintWriter;
-import java.util.Iterator;
 import java.util.List;
 
 
@@ -60,9 +59,7 @@ public abstract class IdlStructBase exte
             return true;
         }
         boolean hasNonEmptyMembers = false;
-        Iterator it = definitions().iterator();
-        while (it.hasNext()) {
-            IdlDefn defn = (IdlDefn)it.next();
+        for (IdlDefn defn : definitions()) {
             if (!defn.isEmptyDef()) {
                 hasNonEmptyMembers = true;
                 break;

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlUnionBranch.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlUnionBranch.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlUnionBranch.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/common/idltypes/IdlUnionBranch.java Fri Jan  6 23:24:33 2012
@@ -20,19 +20,18 @@
 package org.apache.cxf.tools.corba.common.idltypes;
 
 import java.io.PrintWriter;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Vector;
 
 
 public final class IdlUnionBranch extends IdlField {
     private boolean isDefault;
-    private List<Object> cases;
+    private List<String> cases;
 
     private IdlUnionBranch(IdlUnion union, String name, IdlType type, boolean hasDefault) {
         super(union, name, type);
         this.isDefault = hasDefault;
-        cases = new Vector<Object>();
+        cases = new Vector<String>();
     }
     
     public static IdlUnionBranch create(IdlUnion union, String name, IdlType type, boolean isDefault) {
@@ -51,10 +50,8 @@ public final class IdlUnionBranch extend
         if (isDefault) {
             pw.println(indent() + "default:");
         } else {
-            Iterator it = cases.iterator();
-
-            while (it.hasNext()) {
-                pw.println(indent() + "case " + it.next() + ":");
+            for (String s : cases) {
+                pw.println(indent() + "case " + s + ":");
             }
         }
 

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/DeferredActionCollection.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/DeferredActionCollection.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/DeferredActionCollection.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/DeferredActionCollection.java Fri Jan  6 23:24:33 2012
@@ -24,7 +24,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cxf.helpers.CastUtils;
 
 /**
  * Class that holds a fully qualified name as the key that represents
@@ -35,21 +34,18 @@ import org.apache.cxf.helpers.CastUtils;
  */
 
 public final class DeferredActionCollection {    
-    Map<String, List<Object>> deferredActions = new HashMap<String, List<Object>>();
+    Map<String, List<DeferredAction>> deferredActions = new HashMap<String, List<DeferredAction>>();
     public void add(Scope scope, DeferredAction action) {
-        Object obj = deferredActions.get(scope.toString());
-        List<Object> list;
-        if (obj == null) {
-            list = new ArrayList<Object>();
+        List<DeferredAction> list = deferredActions.get(scope.toString());
+        if (list == null) {
+            list = new ArrayList<DeferredAction>();
             deferredActions.put(scope.toString(), list);
-        } else {
-            list = CastUtils.cast((List)obj);
         }
         list.add(action);
     }
     
     public void remove(Scope scope, DeferredAction action) {
-        List list = deferredActions.get(scope.toString());
+        List<DeferredAction> list = deferredActions.get(scope.toString());
         if (list != null) {
             list.remove(action);
         }
@@ -63,7 +59,7 @@ public final class DeferredActionCollect
         return deferredActions.size();
     }
     
-    public List getActions(Scope scope) {   
+    public List<DeferredAction> getActions(Scope scope) {   
         return deferredActions.get(scope.toString());
     }
 }

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/IDLToWSDLProcessor.java Fri Jan  6 23:24:33 2012
@@ -538,7 +538,7 @@ public class IDLToWSDLProcessor extends 
         List<CorbaTypeImpl> types = visitor.getTypeMap().getStructOrExceptionOrUnion();
         ModuleToNSMapper mapper = visitor.getModuleToNSMapper();
         WSDLSchemaManager manager = visitor.getManager();
-        Collection namespaces = def.getNamespaces().values();
+        Collection<String> namespaces = CastUtils.cast(def.getNamespaces().values());
         Set<Map.Entry<String, String>> userModuleMappings = mapper.getUserMapping().entrySet();
         
         if (types != null) {
@@ -658,8 +658,8 @@ public class IDLToWSDLProcessor extends 
         return map;
     }
 
-    private Map<String, List> getExcludedModules(String modules) {
-        Map<String, List> exModules = new HashMap<String, List>();
+    private Map<String, List<String>> getExcludedModules(String modules) {
+        Map<String, List<String>> exModules = new HashMap<String, List<String>>();
         if ((modules != null) && (modules.length() > 0)) {
             if ((modules.startsWith("[")) && (modules.endsWith("]"))) {
                 modules = modules.substring(1, modules.length() - 1);
@@ -667,7 +667,7 @@ public class IDLToWSDLProcessor extends 
                 while (tokens.hasMoreTokens()) {
                     String token = tokens.nextToken();
                     //Revisit, Do we also take in the imports of the wsdl/schema?
-                    exModules.put(token, new ArrayList());
+                    exModules.put(token, new ArrayList<String>());
                 }               
             } else if (modules.startsWith(":")) {
                 //TO DO

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ModuleToNSMapper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ModuleToNSMapper.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ModuleToNSMapper.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ModuleToNSMapper.java Fri Jan  6 23:24:33 2012
@@ -29,12 +29,12 @@ import org.apache.cxf.tools.corba.common
 public class ModuleToNSMapper {
 
     Map<String, String> userMap;
-    Map<String, List> exModules;
+    Map<String, List<String>> exModules;
     boolean defaultMapping = true;
 
     public ModuleToNSMapper() {
         userMap = new HashMap<String, String>();
-        exModules = new HashMap<String, List>();
+        exModules = new HashMap<String, List<String>>();
     }
 
     public void setDefaultMapping(boolean flag) {
@@ -53,11 +53,11 @@ public class ModuleToNSMapper {
         return userMap;
     }
 
-    public void setExcludedModuleMap(Map<String, List> map) {
+    public void setExcludedModuleMap(Map<String, List<String>> map) {
         exModules = map;
     }
     
-    public Map<String, List> getExcludedModuleMap() {
+    public Map<String, List<String>> getExcludedModuleMap() {
         return exModules;
     }
 
@@ -65,7 +65,7 @@ public class ModuleToNSMapper {
         return exModules.keySet().iterator();
     }
 
-    public List getExcludedImports(String module) {
+    public List<String> getExcludedImports(String module) {
         return exModules.get(module);
     }
 

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ObjectReferenceVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ObjectReferenceVisitor.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ObjectReferenceVisitor.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ObjectReferenceVisitor.java Fri Jan  6 23:24:33 2012
@@ -38,6 +38,7 @@ import antlr.collections.AST;
 import org.apache.cxf.binding.corba.wsdl.BindingType;
 import org.apache.cxf.binding.corba.wsdl.CorbaTypeImpl;
 import org.apache.cxf.binding.corba.wsdl.Object;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.tools.corba.common.ReferenceConstants;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaAnnotation;
@@ -367,20 +368,16 @@ public class ObjectReferenceVisitor exte
         // We need to find the binding which corresponds with the given repository ID.
         // This is specified in the schema definition for a custom endpoint
         // reference type.
-        Collection bindings = wsdlDef.getBindings().values();
+        Collection<Binding> bindings = CastUtils.cast(wsdlDef.getBindings().values());
         if (bindings.isEmpty() && !wsdlVisitor.getModuleToNSMapper().isDefaultMapping()) {
             // If we are not using the default mapping, then the binding definitions are not
             // located in the current Definition object, but nistead in the root Definition
-            bindings = wsdlVisitor.getDefinition().getBindings().values();
+            bindings = CastUtils.cast(wsdlVisitor.getDefinition().getBindings().values());
         }
 
-        for (Iterator iter = bindings.iterator(); iter.hasNext();) {
-            Binding b = (Binding)iter.next();
-            List extElements = b.getExtensibilityElements();
-
-            for (Iterator extIter = extElements.iterator(); extIter.hasNext();) {
-                java.lang.Object element = extIter.next();
-
+        for (Binding b : bindings) {
+            List<?> extElements = b.getExtensibilityElements();
+            for (java.lang.Object element: extElements) {
                 if (element instanceof BindingType) {
                     BindingType bt = (BindingType)element;
                     if (bt.getRepositoryID().equals(repositoryID)) {

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/PortTypeVisitor.java Fri Jan  6 23:24:33 2012
@@ -20,9 +20,9 @@
 package org.apache.cxf.tools.corba.processors.idl;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import javax.wsdl.Binding;
 import javax.wsdl.BindingOperation;
@@ -205,7 +205,7 @@ public class PortTypeVisitor extends Vis
     private void handleDeferredActions(DeferredActionCollection deferredActions,
                                        Scope scopedName,
                                        AST identifierNode) {
-        List list = deferredActions.getActions(scopedName);
+        List<DeferredAction> list = deferredActions.getActions(scopedName);
         if ((list != null) && !list.isEmpty()) {
             XmlSchemaType stype = null;
             CorbaTypeImpl ctype = null;
@@ -219,9 +219,7 @@ public class PortTypeVisitor extends Vis
                 stype = visitor.getSchemaType();
                 ctype = visitor.getCorbaType();
             }
-            Iterator iterator = list.iterator();
-            while (iterator.hasNext()) {
-                DeferredAction action = (DeferredAction) iterator.next();
+            for (DeferredAction action : list) {
                 if (action instanceof SchemaDeferredAction
                     && (stype != null) && (ctype != null)) {
                     SchemaDeferredAction schemaAction = (SchemaDeferredAction) action;
@@ -266,10 +264,8 @@ public class PortTypeVisitor extends Vis
     }
 
     private boolean queryBinding(QName bqname) {
-        Map bindings = definition.getBindings();
-        Iterator i = bindings.values().iterator();
-        while (i.hasNext()) {
-            Binding binding = (Binding)i.next();
+        Collection<Binding> bindings = CastUtils.cast(definition.getBindings().values());
+        for (Binding binding : bindings) {
             if (binding.getQName().getLocalPart().equals(bqname.getLocalPart())) {
                 return true;
             }
@@ -445,7 +441,7 @@ public class PortTypeVisitor extends Vis
     }
 
     private BindingType findCorbaBinding(Binding binding) {
-        java.util.List list = binding.getExtensibilityElements();
+        List<?> list = binding.getExtensibilityElements();
         for (int i = 0; i < list.size(); i++) {
             if (list.get(i) instanceof BindingType) {
                 return (BindingType) list.get(i);

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java Fri Jan  6 23:24:33 2012
@@ -20,7 +20,6 @@
 package org.apache.cxf.tools.corba.processors.idl;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.wsdl.Definition;
@@ -398,9 +397,7 @@ public class ScopedNameVisitor extends V
         }        
         
         if (scopeList != null) {            
-            Iterator iterator = scopeList.iterator();
-            while (iterator.hasNext()) {
-                Scope inheritScope = (Scope)iterator.next();
+            for (Scope inheritScope : scopeList) {
 
                 Scope scopedName = new Scope(inheritScope, node);
                 result = findScopeSchemaType(scopedName, schemaRef, wsdlVisitor, holder);
@@ -497,9 +494,7 @@ public class ScopedNameVisitor extends V
                                                            QName schemaTypeName,
                                                            Scope scopedName) {
         CorbaTypeImpl result = null;
-        Iterator corbaTypes = typeMap.getStructOrExceptionOrUnion().iterator();
-        while (corbaTypes.hasNext()) {
-            CorbaTypeImpl type = (CorbaTypeImpl) corbaTypes.next();         
+        for (CorbaTypeImpl type : typeMap.getStructOrExceptionOrUnion()) {         
             if ((type instanceof Sequence)
                 || (type instanceof Array)
                 || (type.getType() == null)
@@ -529,9 +524,7 @@ public class ScopedNameVisitor extends V
 
     public static CorbaTypeImpl findCorbaType(TypeMappingType typeMap, QName typeName) {
         CorbaTypeImpl result = null;
-        Iterator corbaTypes = typeMap.getStructOrExceptionOrUnion().iterator();
-        while (corbaTypes.hasNext()) {
-            CorbaTypeImpl type = (CorbaTypeImpl) corbaTypes.next();
+        for (CorbaTypeImpl type : typeMap.getStructOrExceptionOrUnion()) {
             if (type.getQName().equals(typeName)) {
                 result = type;
                 break;

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StructVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StructVisitor.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StructVisitor.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/StructVisitor.java Fri Jan  6 23:24:33 2012
@@ -224,11 +224,11 @@ public class StructVisitor extends Visit
     private void processForwardStructActions(Scope structScope) {
         if (wsdlVisitor.getDeferredActions() != null) {
             DeferredActionCollection deferredActions = wsdlVisitor.getDeferredActions();
-            List list = deferredActions.getActions(structScope);
+            List<DeferredAction> list = deferredActions.getActions(structScope);
             if ((list != null) && !list.isEmpty()) {
                 XmlSchemaType stype = getSchemaType();
                 CorbaTypeImpl ctype = getCorbaType();
-                Iterator iterator = list.iterator();
+                Iterator<DeferredAction> iterator = list.iterator();
                 while (iterator.hasNext()) {
                     SchemaDeferredAction action = (SchemaDeferredAction)iterator.next();
                     action.execute(stype, ctype);

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/UnionVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/UnionVisitor.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/UnionVisitor.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/UnionVisitor.java Fri Jan  6 23:24:33 2012
@@ -268,11 +268,11 @@ public class UnionVisitor extends Visito
     private void processForwardUnionActions(Scope unionScope) {
         if (wsdlVisitor.getDeferredActions() != null) {
             DeferredActionCollection deferredActions = wsdlVisitor.getDeferredActions();
-            List list = deferredActions.getActions(unionScope);
+            List<DeferredAction> list = deferredActions.getActions(unionScope);
             if ((list != null) && !list.isEmpty()) {
                 XmlSchemaType stype = getSchemaType();
                 CorbaTypeImpl ctype = getCorbaType();
-                Iterator iterator = list.iterator();
+                Iterator<DeferredAction> iterator = list.iterator();
                 while (iterator.hasNext()) {
                     SchemaDeferredAction action = (SchemaDeferredAction)iterator.next();
                     action.execute(stype, ctype);

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLASTVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLASTVisitor.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLASTVisitor.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/WSDLASTVisitor.java Fri Jan  6 23:24:33 2012
@@ -21,7 +21,7 @@ package org.apache.cxf.tools.corba.proce
 
 import java.io.Writer;
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
@@ -36,12 +36,14 @@ import javax.wsdl.Types;
 import javax.wsdl.WSDLException;
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
 
 import antlr.ASTVisitor;
 import antlr.collections.AST;
 
 import org.apache.cxf.binding.corba.wsdl.CorbaConstants;
 import org.apache.cxf.binding.corba.wsdl.TypeMappingType;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.tools.common.ToolException;
 import org.apache.cxf.tools.corba.common.ToolCorbaConstants;
 import org.apache.cxf.tools.corba.common.WSDLUtils;
@@ -248,13 +250,12 @@ public final class WSDLASTVisitor implem
 
     public Binding[] getCorbaBindings() {
         List<Binding> result = new ArrayList<Binding>();
-        Map bindings = definition.getBindings();
-        Iterator it = bindings.values().iterator();
-        while (it.hasNext()) {
-            Binding binding = (Binding) it.next();
-            List extElements = binding.getExtensibilityElements();
+        Map<QName, Binding> bindings = CastUtils.cast(definition.getBindings());
+        for (Binding binding : bindings.values()) {
+            List<ExtensibilityElement> extElements 
+                = CastUtils.cast(binding.getExtensibilityElements());
             for (int i = 0; i < extElements.size(); i++) {
-                ExtensibilityElement el = (ExtensibilityElement) extElements.get(i);
+                ExtensibilityElement el = extElements.get(i);
                 if (el.getElementType().equals(CorbaConstants.NE_CORBA_BINDING)) {
                     result.add(binding);
                     break;
@@ -367,21 +368,18 @@ public final class WSDLASTVisitor implem
             }
         }
 
-        Iterator iter = definition.getAllPortTypes().values().iterator();
-        while (iter.hasNext()) {
-            PortType port = (PortType)iter.next();
+        Collection<PortType> portTypes = CastUtils.cast(definition.getAllPortTypes().values());
+        for (PortType port : portTypes) {
             def.addPortType(port);
         }
 
-        iter = definition.getMessages().values().iterator();
-        while (iter.hasNext()) {
-            Message msg = (Message)iter.next();
+        Collection<Message> messages = CastUtils.cast(definition.getMessages().values());
+        for (Message msg : messages) {
             def.addMessage(msg);
         }
 
-        iter = definition.getNamespaces().values().iterator();
-        while (iter.hasNext()) {
-            String namespace = (String)iter.next();
+        Collection<String> namespaces = CastUtils.cast(definition.getNamespaces().values());
+        for (String namespace : namespaces) {
             String prefix = definition.getPrefix(namespace);
             if (!"corba".equals(prefix)) {
                 def.addNamespace(prefix, namespace);
@@ -390,9 +388,8 @@ public final class WSDLASTVisitor implem
             }
         }
 
-        iter = definition.getImports().values().iterator();
-        while (iter.hasNext()) {
-            Import importType = (Import)iter.next();
+        Collection<Import> imports = CastUtils.cast(definition.getImports().values());
+        for (Import importType : imports) {
             def.addImport(importType);
         }
 
@@ -413,26 +410,21 @@ public final class WSDLASTVisitor implem
             def = manager.createWSDLDefinition(targetNamespace);
         }
 
-        Iterator iter = definition.getNamespaces().values().iterator();
-        while (iter.hasNext()) {
-            String namespace = (String)iter.next();
+        Collection<String> namespaces = CastUtils.cast(definition.getNamespaces().values());
+        for (String namespace : namespaces) {
             String prefix = definition.getPrefix(namespace);
             def.addNamespace(prefix, namespace);
         }
-
-        iter = definition.getAllBindings().values().iterator();
-        while (iter.hasNext()) {
-            Binding binding = (Binding)iter.next();
+        Collection<Binding> bindings = CastUtils.cast(definition.getAllBindings().values());
+        for (Binding binding : bindings) {
             def.addBinding(binding);
         }
-        iter = definition.getAllServices().values().iterator();
-        while (iter.hasNext()) {
-            Service service = (Service)iter.next();
+        Collection<Service> services = CastUtils.cast(definition.getAllServices().values());
+        for (Service service : services) {
             def.addService(service);
         }
-        iter = definition.getExtensibilityElements().iterator();
-        while (iter.hasNext()) {
-            ExtensibilityElement ext = (ExtensibilityElement)iter.next();
+        Collection<ExtensibilityElement> extns = CastUtils.cast(definition.getExtensibilityElements());
+        for (ExtensibilityElement ext : extns) {
             def.addExtensibilityElement(ext);
         }
 
@@ -458,7 +450,7 @@ public final class WSDLASTVisitor implem
         return moduleToNSMapper;
     }
 
-    public void setExcludedModules(Map<String, List> modules) {
+    public void setExcludedModules(Map<String, List<String>> modules) {
         moduleToNSMapper.setExcludedModuleMap(modules);
     }
 

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java Fri Jan  6 23:24:33 2012
@@ -20,7 +20,6 @@
 package org.apache.cxf.tools.corba.processors.wsdl;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
 
@@ -37,6 +36,7 @@ import org.apache.cxf.binding.corba.wsdl
 import org.apache.cxf.binding.corba.wsdl.ModeType;
 import org.apache.cxf.binding.corba.wsdl.ParamType;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaAnnotation;
 import org.apache.ws.commons.schema.XmlSchemaAnnotationItem;
@@ -127,9 +127,8 @@ public final class WSDLParameter {
 
         if (input != null) {
             Message msg = input.getMessage();
-            Iterator i = msg.getOrderedParts(null).iterator();
-            while (i.hasNext()) {
-                Part part = (Part)i.next();
+            List<Part> parts = CastUtils.cast(msg.getOrderedParts(null));
+            for (Part part : parts) {
                 XmlSchemaType schemaType = null;
                 boolean isObjectRef = isObjectReference(xmlSchemaList, part.getElementName());
                 if (part.getElementName() != null && !isObjectRef) {
@@ -227,9 +226,8 @@ public final class WSDLParameter {
 
         if (output != null) {
             Message msg = output.getMessage();
-            Iterator i = msg.getOrderedParts(null).iterator();
-            while (i.hasNext()) {
-                Part part = (Part)i.next();
+            List<Part> parts = CastUtils.cast(msg.getOrderedParts(null));
+            for (Part part : parts) {
                 XmlSchemaType schemaType = null;
                 // check if in input list
                 String mode = "out";
@@ -313,10 +311,10 @@ public final class WSDLParameter {
         while (inputit.hasNext()) {
             ParamType d2 = (ParamType)inputit.next();
             if (d2.getMode().value().equals("inout")) {
-                ListIterator it = outputs.listIterator();
+                ListIterator<ParamType> it = outputs.listIterator();
 
                 while (it.hasNext()) {
-                    ParamType d3 = (ParamType)it.next();
+                    ParamType d3 = it.next();
                     if (!d3.getName().equals(d2.getName()) && (!simpleOrdering)
                         && (!d3.getMode().value().equals("inout"))) {
                         // the in/outs are in a different order in the

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaBinding.java Fri Jan  6 23:24:33 2012
@@ -23,6 +23,7 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -144,15 +145,13 @@ public class WSDLToCorbaBinding {
             for (String interfaceName : interfaceNames) {
                 PortType portType = null;
 
-                Map portTypes = def.getAllPortTypes();
+                Map<QName, PortType> portTypes = CastUtils.cast(def.getAllPortTypes());
                 if (portTypes != null) {
-                    Iterator it2 = portTypes.keySet().iterator();
-                    while (it2.hasNext()) {
-                        QName existPortQName = (QName)it2.next();
+                    for (QName existPortQName : portTypes.keySet()) {
                         if (!existPortQName.getLocalPart().equals(interfaceName)) {
                             portType = null;
                         } else {
-                            portType = (PortType)portTypes.get(existPortQName);
+                            portType = portTypes.get(existPortQName);
                             break;
                         }
                     }
@@ -179,7 +178,7 @@ public class WSDLToCorbaBinding {
     }
 
     private List<PortType> getPortTypeList() throws Exception {
-        Map portTypes = def.getAllPortTypes();
+        Map<QName, PortType> portTypes = CastUtils.cast(def.getAllPortTypes());
         List<PortType> intfs = null;
 
         if (portTypes == null) {
@@ -195,11 +194,10 @@ public class WSDLToCorbaBinding {
                 intfs.add(portType);
             } else if (portTypes.size() > 1) {
                 if (def.getAllBindings().size() > 0) {
-                    throwMultipleMultipleTypeException(def.getAllBindings());
+                    throwMultipleMultipleTypeException(CastUtils.cast(def.getAllBindings().keySet(),
+                                                                      QName.class));
                 }
-                Iterator iter = portTypes.values().iterator();
-                while (iter.hasNext()) {
-                    PortType port = (PortType)iter.next();
+                for (PortType port : portTypes.values()) {
                     interfaceNames.add(port.getQName().getLocalPart());
                     intfs.add(port);
                 }
@@ -208,16 +206,16 @@ public class WSDLToCorbaBinding {
         return intfs;
     }
 
-    private void throwMultipleMultipleTypeException(Map binds) throws Exception {
+    private void throwMultipleMultipleTypeException(Collection<QName> binds) throws Exception {
         StringBuilder sb = new StringBuilder();
         org.apache.cxf.common.i18n.Message msgDef =
             new org.apache.cxf.common.i18n.Message("Multiple Bindings already defined in the wsdl", LOG);
         sb.append(msgDef.toString());
-        Iterator it2 = binds.keySet().iterator();
+        Iterator<QName> it2 = binds.iterator();
         int cnt = 0;
         while (it2.hasNext()) {
             cnt++;
-            sb.append("  " + cnt + " --> " + ((QName) it2.next()).getLocalPart());
+            sb.append("  " + cnt + " --> " + it2.next().getLocalPart());
         }
         throw new Exception(sb.toString());
     }
@@ -389,10 +387,8 @@ public class WSDLToCorbaBinding {
                 }
                 // add Faults
                 if (op.getFaults() != null && op.getFaults().size() > 0) {
-                    Map faults = op.getFaults();
-                    Iterator i = faults.values().iterator();
-                    while (i.hasNext()) {
-                        Fault fault = (Fault)i.next();
+                    Collection<Fault> faults = CastUtils.cast(op.getFaults().values());
+                    for (Fault fault : faults) {
                         BindingFault bindingFault = definition.createBindingFault();
                         bindingFault.setName(fault.getName());
                         bindingOperation.addBindingFault(bindingFault);
@@ -453,10 +449,8 @@ public class WSDLToCorbaBinding {
             operationType.setReturn(retType);
         }
 
-        Map faults = op.getFaults();
-        Iterator i = faults.values().iterator();
-        while (i.hasNext()) {
-            Fault fault = (Fault)i.next();
+        Collection<Fault> faults = CastUtils.cast(op.getFaults().values());
+        for (Fault fault : faults) {
             RaisesType raisestype = new RaisesType();
             CorbaTypeImpl extype = convertFaultToCorbaType(xmlSchemaType, fault);
             if (extype != null) {
@@ -471,8 +465,8 @@ public class WSDLToCorbaBinding {
 
     private void addCorbaTypeMap(Definition definition) throws Exception {
 
-        Iterator t = definition.getExtensibilityElements().iterator();
-        Iterator j = definition.getExtensibilityElements().iterator();
+        Iterator<?> t = definition.getExtensibilityElements().iterator();
+        Iterator<?> j = definition.getExtensibilityElements().iterator();
         while (t.hasNext()) {
             if (j.next() instanceof TypeMappingType) {
                 typeMappingType = (TypeMappingType)t.next();
@@ -599,7 +593,7 @@ public class WSDLToCorbaBinding {
     private CorbaTypeImpl convertFaultToCorbaType(XmlSchema xmlSchema, Fault fault) throws Exception {
         org.apache.cxf.binding.corba.wsdl.Exception corbaex = null;
         XmlSchemaType schemaType = null;
-        Iterator parts = fault.getMessage().getParts().values().iterator();
+        Iterator<Part> parts = CastUtils.cast(fault.getMessage().getParts().values().iterator());
 
         if (!parts.hasNext()) {
             String msgStr = "Fault " + fault.getMessage().getQName().getLocalPart()
@@ -609,7 +603,7 @@ public class WSDLToCorbaBinding {
             throw new Exception(msg.toString());
         }
 
-        Part part = (Part)parts.next();
+        Part part = parts.next();
         schemaType = helper.lookUpType(part);
         if (schemaType != null) {
             QName name = schemaType.getQName();
@@ -678,7 +672,7 @@ public class WSDLToCorbaBinding {
     }
 
     private org.apache.cxf.binding.corba.wsdl.Exception createCorbaException(QName schemaTypeName,
-                                                                                  XmlSchemaType stype)
+                                                                             XmlSchemaType stype)
         throws Exception {
         org.apache.cxf.binding.corba.wsdl.Exception corbaex = null;
         XmlSchemaComplexType complex = null;
@@ -696,19 +690,15 @@ public class WSDLToCorbaBinding {
                                     + defaultName.getLocalPart()
                                     + WSDLToCorbaHelper.IDL_VERSION);
             String uri = defaultName.getNamespaceURI();
-            List attributeMembers = helper.processAttributesAsMembers(complex.getAttributes(),
+            List<MemberType> attributeMembers = helper.processAttributesAsMembers(complex.getAttributes(),
                                                                       uri);
-            Iterator iterator = attributeMembers.iterator();
-            while (iterator.hasNext()) {
-                MemberType memberType = (MemberType)iterator.next();
+            for (MemberType memberType : attributeMembers) {
                 corbaex.getMember().add(memberType);
             }
-            List members = helper.processContainerAsMembers(complex.getParticle(),
+            List<MemberType> members = helper.processContainerAsMembers(complex.getParticle(),
                                                             stype.getQName(),
                                                             defaultName);
-            Iterator it = members.iterator();
-            while (it.hasNext()) {
-                MemberType memberType = (MemberType)it.next();
+            for (MemberType memberType : members) {
                 corbaex.getMember().add(memberType);
             }
         }
@@ -858,7 +848,7 @@ public class WSDLToCorbaBinding {
         interfaceNames.add(interfaceName);
     }
 
-    public List getInterfaceNames() {
+    public List<String> getInterfaceNames() {
         return interfaceNames;
     }
 

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java Fri Jan  6 23:24:33 2012
@@ -21,7 +21,7 @@ package org.apache.cxf.tools.corba.proce
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -50,6 +50,7 @@ import org.apache.cxf.binding.corba.wsdl
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.xmlschema.SchemaCollection;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.tools.corba.common.CorbaPrimitiveMap;
 import org.apache.cxf.tools.corba.common.ReferenceConstants;
 import org.apache.cxf.tools.corba.common.WSDLUtils;
@@ -73,6 +74,7 @@ import org.apache.ws.commons.schema.XmlS
 import org.apache.ws.commons.schema.XmlSchemaMaxLengthFacet;
 import org.apache.ws.commons.schema.XmlSchemaParticle;
 import org.apache.ws.commons.schema.XmlSchemaSequence;
+import org.apache.ws.commons.schema.XmlSchemaSequenceMember;
 import org.apache.ws.commons.schema.XmlSchemaSimpleContent;
 import org.apache.ws.commons.schema.XmlSchemaSimpleContentExtension;
 import org.apache.ws.commons.schema.XmlSchemaSimpleContentRestriction;
@@ -81,6 +83,7 @@ import org.apache.ws.commons.schema.XmlS
 import org.apache.ws.commons.schema.XmlSchemaSimpleTypeRestriction;
 import org.apache.ws.commons.schema.XmlSchemaType;
 import org.apache.ws.commons.schema.XmlSchemaUse;
+import org.apache.ws.commons.schema.utils.XmlSchemaObjectBase;
 
 public class WSDLToCorbaHelper {
 
@@ -153,13 +156,13 @@ public class WSDLToCorbaHelper {
         return corbaTypeImpl;
     }
 
-    protected List processContainerAsMembers(XmlSchemaParticle particle,
+    protected List<MemberType> processContainerAsMembers(XmlSchemaParticle particle,
                                              QName defaultName,
                                              QName schemaTypeName)
         throws Exception {
         List<MemberType> members = new ArrayList<MemberType>();
 
-        Iterator iterL = null;
+        Iterator<? extends XmlSchemaObjectBase> iterL = null;
         if (particle instanceof XmlSchemaSequence) {
             XmlSchemaSequence scontainer = (XmlSchemaSequence)particle;
             iterL = scontainer.getItems().iterator();
@@ -171,7 +174,7 @@ public class WSDLToCorbaHelper {
             iterL = acontainer.getItems().iterator();
         } else {
             LOG.warning("Unknown particle type " + particle.getClass().getName());
-            iterL = Collections.emptyList().iterator();
+            iterL = new ArrayList<XmlSchemaObjectBase>().iterator();
         }
 
         while (iterL.hasNext()) {
@@ -417,9 +420,8 @@ public class WSDLToCorbaHelper {
         struct.setRepositoryID(REPO_STRING + seqName.getLocalPart().replace('.', '/') + IDL_VERSION);
         struct.setType(schemaTypeName);
 
-        List members = processContainerAsMembers(seq, defaultName, schemaTypeName);
-        for (Iterator iterator = members.iterator(); iterator.hasNext();) {
-            MemberType memberType = (MemberType)iterator.next();
+        List<MemberType> members = processContainerAsMembers(seq, defaultName, schemaTypeName);
+        for (MemberType memberType : members) {
             struct.getMember().add(memberType);
         }
 
@@ -464,9 +466,8 @@ public class WSDLToCorbaHelper {
         type.setQName(allName);
         type.setType(schematypeName);
 
-        List members = processContainerAsMembers(seq, defaultName, schematypeName);
-        for (Iterator iterator = members.iterator(); iterator.hasNext();) {
-            MemberType memberType = (MemberType)iterator.next();
+        List<MemberType> members = processContainerAsMembers(seq, defaultName, schematypeName);
+        for (MemberType memberType : members) {
             type.getMember().add(memberType);
         }
 
@@ -995,7 +996,7 @@ public class WSDLToCorbaHelper {
             } else {
                 uri = defaultName.getNamespaceURI();
             }
-            List attlist2 = processAttributesAsMembers(complex.getAttributes(), uri);
+            List<MemberType> attlist2 = processAttributesAsMembers(complex.getAttributes(), uri);
             for (int i = 0; i < attlist2.size(); i++) {
                 MemberType member = (MemberType)attlist2.get(i);
                 corbaStruct.getMember().add(member);
@@ -1003,10 +1004,10 @@ public class WSDLToCorbaHelper {
         }
 
         if (complex.getParticle() != null) {
-            List members = processContainerAsMembers(complex.getParticle(), defaultName, schematypeName);
+            List<MemberType> members = processContainerAsMembers(complex.getParticle(),
+                                                                 defaultName, schematypeName);
 
-            for (Iterator it = members.iterator(); it.hasNext();) {
-                MemberType memberType = (MemberType)it.next();
+            for (MemberType memberType : members) {
                 corbaStruct.getMember().add(memberType);
             }
         }
@@ -1020,7 +1021,7 @@ public class WSDLToCorbaHelper {
                                                 QName defaultName, Struct corbaStruct, QName schematypeName)
         throws Exception {
         XmlSchemaType base = null;
-        List attrMembers = null;
+        List<MemberType> attrMembers = null;
         CorbaTypeImpl basetype = null;
 
         String uri;
@@ -1138,7 +1139,7 @@ public class WSDLToCorbaHelper {
         corbaStruct.getMember().add(memberType);
 
         // process attributes at complexContent level
-        List attlist1 = processAttributesAsMembers(list, uri);
+        List<MemberType> attlist1 = processAttributesAsMembers(list, uri);
         for (int i = 0; i < attlist1.size(); i++) {
             MemberType member = (MemberType)attlist1.get(i);
             corbaStruct.getMember().add(member);
@@ -1287,8 +1288,8 @@ public class WSDLToCorbaHelper {
         if (complex.getParticle() instanceof XmlSchemaSequence) {
             XmlSchemaSequence seq = (XmlSchemaSequence)complex.getParticle();
 
-            Iterator iterator = seq.getItems().iterator();
-            Iterator iter = seq.getItems().iterator();
+            Iterator<XmlSchemaSequenceMember> iterator = seq.getItems().iterator();
+            Iterator<XmlSchemaSequenceMember> iter = seq.getItems().iterator();
             while (iterator.hasNext()) {
                 if (iter.next() instanceof XmlSchemaElement) {
                     arrayEl = (XmlSchemaElement)iterator.next();
@@ -1366,7 +1367,7 @@ public class WSDLToCorbaHelper {
         corbaUnion.setType(schematypeName);
 
         XmlSchemaSequence stype = (XmlSchemaSequence)complex.getParticle();
-        Iterator it = stype.getItems().iterator();
+        Iterator<XmlSchemaSequenceMember> it = stype.getItems().iterator();
         XmlSchemaParticle st1 = (XmlSchemaParticle)it.next();
         XmlSchemaParticle st2 = (XmlSchemaParticle)it.next();
         XmlSchemaElement discEl = null;
@@ -1384,13 +1385,13 @@ public class WSDLToCorbaHelper {
             .getSchemaType(), null, false);
         corbaUnion.setDiscriminator(disctype.getQName());
 
-        List fields = processContainerAsMembers(choice, defaultName, schematypeName);
+        List<MemberType> fields = processContainerAsMembers(choice, defaultName, schematypeName);
 
         List<String> caselist = new ArrayList<String>();
 
         if (disctype instanceof Enum) {
             Enum corbaenum = (Enum)disctype;
-            Iterator iterator = corbaenum.getEnumerator().iterator();
+            Iterator<Enumerator> iterator = corbaenum.getEnumerator().iterator();
 
             while (iterator.hasNext()) {
                 Enumerator enumerator = (Enumerator)iterator.next();
@@ -1470,7 +1471,7 @@ public class WSDLToCorbaHelper {
         // add to the list of possible recursive types
         recursionMap.put(name, corbaUnion);
 
-        List fields = processContainerAsMembers(choice, defaultName, schematypeName);
+        List<MemberType> fields = processContainerAsMembers(choice, defaultName, schematypeName);
 
         //Choose an Integer as a Discriminator
         List<String> caselist = new ArrayList<String>();
@@ -1497,9 +1498,9 @@ public class WSDLToCorbaHelper {
             return true;
         }
         if (!typeMappingType.getStructOrExceptionOrUnion().isEmpty()) {
-            Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
+            Iterator<CorbaTypeImpl> i = typeMappingType.getStructOrExceptionOrUnion().iterator();
             while (i.hasNext()) {
-                CorbaTypeImpl type = (CorbaTypeImpl)i.next();
+                CorbaTypeImpl type = i.next();
                 if ((corbaName != null) && type.getType() != null && corbaType != null
                     && (corbaName.equals(type.getName()))
                     && (corbaType.getLocalPart().equals(type.getType().getLocalPart()))
@@ -1517,9 +1518,9 @@ public class WSDLToCorbaHelper {
         String corbaName = corbaTypeImpl.getName();
         String corbaType = corbaTypeImpl.getType().getLocalPart();
         if (!typeMappingType.getStructOrExceptionOrUnion().isEmpty()) {
-            Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
+            Iterator<CorbaTypeImpl> i = typeMappingType.getStructOrExceptionOrUnion().iterator();
             while (i.hasNext()) {
-                CorbaTypeImpl type = (CorbaTypeImpl)i.next();
+                CorbaTypeImpl type = i.next();
                 if (corbaName.equals(type.getName())
                     && corbaType.equals(type.getType().getLocalPart())
                     && type instanceof Struct) {
@@ -1584,10 +1585,8 @@ public class WSDLToCorbaHelper {
     }
 
     protected static boolean queryBinding(Definition definition, QName bqname) {
-        Map bindings = definition.getBindings();
-        Iterator i = bindings.values().iterator();
-        while (i.hasNext()) {
-            Binding binding = (Binding)i.next();
+        Collection<Binding> bindings = CastUtils.cast(definition.getBindings().values());
+        for (Binding binding : bindings) {
             if (binding.getQName().getLocalPart().equals(bqname.getLocalPart())) {
                 return true;
             }

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToIDLAction.java Fri Jan  6 23:24:33 2012
@@ -23,9 +23,9 @@ import java.io.File;
 import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.StringTokenizer;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -62,6 +62,7 @@ import org.apache.cxf.binding.corba.wsdl
 import org.apache.cxf.binding.corba.wsdl.Union;
 import org.apache.cxf.binding.corba.wsdl.Unionbranch;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.tools.corba.common.idltypes.CorbaUtils;
 import org.apache.cxf.tools.corba.common.idltypes.IdlAnonArray;
 import org.apache.cxf.tools.corba.common.idltypes.IdlAnonFixed;
@@ -136,17 +137,15 @@ public class WSDLToIDLAction {
         } else {
             // generate idl for all bindings in the file.
             // each idl file will have the name of the binding.
-            Map bindingList = def.getAllBindings();
-            if (bindingList.size() == 0) {
+            Collection<Binding> bindings = CastUtils.cast(def.getAllBindings().values());
+            if (bindings.size() == 0) {
                 String msgStr = "No bindings exists within this WSDL.";
                 org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message(msgStr, LOG);
                 throw new Exception(msg.toString());
             } else {
                 List<QName> portTypes = new ArrayList<QName>();
-                Iterator iter = bindingList.values().iterator();
-                while (iter.hasNext()) {
-                    Binding binding = (Binding)iter.next();
-                    List ext = binding.getExtensibilityElements();
+                for (Binding binding : bindings) {
+                    List<?> ext = binding.getExtensibilityElements();
                     if (!(ext.get(0) instanceof BindingType)) {
                         continue;
                     }
@@ -191,7 +190,7 @@ public class WSDLToIDLAction {
     }    
 
     private void generateIDL(Definition definition, Binding binding) {
-        List ext = binding.getExtensibilityElements();
+        List<?> ext = binding.getExtensibilityElements();
         if (!(ext.get(0) instanceof BindingType)) {
             // throw an error not a corba binding
             throw new RuntimeException(binding.getQName() + " is not a corba binding, "
@@ -229,7 +228,7 @@ public class WSDLToIDLAction {
     
     private void collectIdlDefns(Binding binding) throws Exception {
         boolean isOneway = false;
-        Iterator iterator = binding.getBindingOperations().iterator();
+        Iterator<?> iterator = binding.getBindingOperations().iterator();
         while (iterator.hasNext()) {
             BindingOperation bindingOperation = (BindingOperation)iterator.next();
             if (bindingOperation.getBindingOutput() == null) {
@@ -244,7 +243,7 @@ public class WSDLToIDLAction {
                               boolean isOneway) throws Exception {
 
         String name = null;
-        Iterator i = bindingOperation.getExtensibilityElements().iterator();
+        Iterator<?> i = bindingOperation.getExtensibilityElements().iterator();
         while (i.hasNext()) {
             org.apache.cxf.binding.corba.wsdl.OperationType opType = 
                 (org.apache.cxf.binding.corba.wsdl.OperationType)i
@@ -272,8 +271,7 @@ public class WSDLToIDLAction {
                 attr = IdlAttribute.create(intf, attrNm, 
                                            findType(t.getIdltype()), true);                               
             } else {
-                Iterator it = opType.getParam().iterator();
-                ParamType arg = (ParamType)it.next();                
+                ParamType arg = opType.getParam().iterator().next();
                 attr = IdlAttribute.create(intf, attrNm, findType(arg.getIdltype()), false);                
             }
             intf.addAttribute(attr);
@@ -299,20 +297,14 @@ public class WSDLToIDLAction {
             idlOp.addReturnType(rt);
         }
 
-        Iterator it = opType.getParam().iterator();
-
-        while (it.hasNext()) {
-            ParamType arg = (ParamType)it.next();
+        for (ParamType arg : opType.getParam()) {
             IdlType type = findType(arg.getIdltype());            
             String mode = arg.getMode().value();
             IdlParam param = IdlParam.create(idlOp, arg.getName(), type, mode);
             idlOp.addParameter(param);
         }
-        
-        Iterator iter = opType.getRaises().iterator();
 
-        while (iter.hasNext()) {
-            RaisesType rs = (RaisesType)iter.next();
+        for (RaisesType rs : opType.getRaises()) {
             IdlType type = findType(rs.getException());            
 
             if (type instanceof IdlException) {
@@ -332,17 +324,10 @@ public class WSDLToIDLAction {
     private void getAllIdlTypes() throws Exception {
 
         try {
-            Iterator types = def.getExtensibilityElements().iterator();
-            TypeMappingType typeMappingType = null;            
-            if (types != null) {
-                while (types.hasNext()) {                    
-                    typeMappingType = (TypeMappingType)types.next();
-                }
-            }
+            TypeMappingType typeMappingType = getTypeMappingType();
             if (typeMappingType != null) {
-                Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
-                while (i.hasNext()) {
-                    CorbaTypeImpl corbaTypeImpl = (CorbaTypeImpl)i.next();                                
+                for (CorbaTypeImpl corbaTypeImpl 
+                    : typeMappingType.getStructOrExceptionOrUnion()) {                                
                     findCorbaIdlType(corbaTypeImpl);
                 }
             }
@@ -355,19 +340,12 @@ public class WSDLToIDLAction {
         CorbaTypeImpl corbaTypeImpl = null;
 
         try {
-
-            Iterator types = def.getExtensibilityElements().iterator();
-            TypeMappingType typeMappingType = null;
-            if (types != null) {
-                while (types.hasNext()) {
-                    typeMappingType = (TypeMappingType)types.next();
-                }
-            }
-            Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
-            while (i.hasNext()) {
-                CorbaTypeImpl corbaType = (CorbaTypeImpl)i.next();
-                if (corbaType.getName().equals(qname.getLocalPart())) {                    
-                    return corbaType;
+            TypeMappingType typeMappingType = getTypeMappingType();
+            if (typeMappingType != null) {
+                for (CorbaTypeImpl corbaType : typeMappingType.getStructOrExceptionOrUnion()) {
+                    if (corbaType.getName().equals(qname.getLocalPart())) {                    
+                        return corbaType;
+                    }
                 }
             }
         } catch (Exception ex) {
@@ -376,7 +354,15 @@ public class WSDLToIDLAction {
                 
         return corbaTypeImpl;         
     }
-
+    private TypeMappingType getTypeMappingType() {
+        Iterator<?> types = def.getExtensibilityElements().iterator();
+        if (types != null) {
+            while (types.hasNext()) {
+                return (TypeMappingType)types.next();
+            }
+        }
+        return null;
+    }
     private IdlType findType(QName qname) throws Exception {        
         String local = qname.getLocalPart();        
         return findIdlType(local, qname, null);                
@@ -610,16 +596,11 @@ public class WSDLToIDLAction {
         } else {
             IdlException exc = IdlException.create(scope, local);
             scope.holdForScope(exc);
-
-            Iterator it = e.getMember().iterator();
-
-            while (it.hasNext()) {
-                MemberType m = (MemberType)it.next();
+            for (MemberType m : e.getMember()) {
                 QName qname = m.getIdltype();
                 IdlType type = findType(qname);                
                 exc.addToScope(IdlField.create(exc, m.getName(), type));
             }
-
             result = exc;
             scope.promoteHeldToScope();
         }
@@ -635,9 +616,7 @@ public class WSDLToIDLAction {
         IdlUnion union = IdlUnion.create(scope, local, disc);
         scope.holdForScope(union);
 
-        Iterator it = u.getUnionbranch().iterator();
-        while (it.hasNext()) {
-            Unionbranch ub = (Unionbranch)it.next();
+        for (Unionbranch ub : u .getUnionbranch()) {
             QName qname = ub.getIdltype();
             IdlType bt = findType(qname);
             boolean isDefault = false;
@@ -646,9 +625,8 @@ public class WSDLToIDLAction {
             }
             IdlUnionBranch b = IdlUnionBranch.create(union, ub.getName(), bt, isDefault);
 
-            Iterator it2 = ub.getCase().iterator();
-            while (it2.hasNext()) {                
-                b.addCase(((CaseType)it2.next()).getLabel());
+            for (CaseType cs : ub.getCase()) {
+                b.addCase(cs.getLabel());
             }
 
             // Ensure that this union will not  be written until all of its circular members are
@@ -682,9 +660,7 @@ public class WSDLToIDLAction {
         IdlStruct struct = IdlStruct.create(scope, local);
         scope.holdForScope(struct);
 
-        Iterator it = s.getMember().iterator();
-        while (it.hasNext()) {
-            MemberType m = (MemberType)it.next();
+        for (MemberType m : s.getMember()) {
             QName qname = m.getIdltype();
             IdlType type = findType(qname);            
             
@@ -803,12 +779,12 @@ public class WSDLToIDLAction {
     private IdlType createEnum(CorbaTypeImpl ctype, IdlScopeBase scope, String local) {
         Enum e = (Enum)ctype;
         IdlEnum enum1 = IdlEnum.create(scope, local);
-        Iterator it = e.getEnumerator().iterator();
+        Iterator<Enumerator> it = e.getEnumerator().iterator();
 
         while (it.hasNext()) {
             // Enumerators are created in the same scope
             // as the enum, according to IDL grammar rules.
-            String n = ((Enumerator)it.next()).getValue();
+            String n = it.next().getValue();
             IdlEnumerator enumerator = IdlEnumerator.create(scope, n);
             scope.addToScope(enumerator);
             enum1.addEnumerator(enumerator);
@@ -838,21 +814,18 @@ public class WSDLToIDLAction {
 
     private Binding findBinding(Definition definition) {
         Binding binding = null;
-        Map bindings = definition.getBindings();
-        Iterator i = bindings.values().iterator();
-        
-        if (bindingName != null) {                    
-            while (i.hasNext()) {
-                binding = (Binding)i.next();
+        Collection<Binding> bindings = CastUtils.cast(definition.getBindings().values());
+        if (bindingName != null) {
+            for (Binding b : bindings) {
+                binding = b;
                 if (binding.getQName().getLocalPart().equals(bindingName)) {
                     return binding;
                 }
             }
         } else {
             if (bindings.size() >= 1) {
-                binding = (Binding)i.next();
+                binding = bindings.iterator().next();
             }
-            
         }
         return binding;
     }

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLTypes.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLTypes.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLTypes.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLTypes.java Fri Jan  6 23:24:33 2012
@@ -108,7 +108,7 @@ public final class WSDLTypes {
                             obj.setBinding(bName);
                             // get the repository id of the binding.
                             String repId = null;
-                            Iterator bindIter = binding.getExtensibilityElements().iterator();
+                            Iterator<?> bindIter = binding.getExtensibilityElements().iterator();
                             while (bindIter.hasNext()) {
                                 BindingType type = (BindingType)bindIter.next();
                                 repId = type.getRepositoryID();
@@ -239,7 +239,8 @@ public final class WSDLTypes {
         return corbaTypeImpl;
     }
 
-    public static Union processUnionBranches(Union corbaUnion, List fields, List<String> caselist) {
+    public static Union processUnionBranches(Union corbaUnion, List<MemberType> fields,
+                                             List<String> caselist) {
         int caseIndex = 0;
 
         for (int i = 0; i < fields.size(); i++) {

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/utils/FileOutputStreamFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/utils/FileOutputStreamFactory.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/utils/FileOutputStreamFactory.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/utils/FileOutputStreamFactory.java Fri Jan  6 23:24:33 2012
@@ -31,17 +31,17 @@ import java.util.List;
 
 public class FileOutputStreamFactory implements OutputStreamFactory {
     String dirName = "";
-    List <Object>fileNames;
+    List<String> fileNames;
     FileOutputStreamFactory parent;
 
     public FileOutputStreamFactory() {
-        fileNames = new LinkedList<Object>();
+        fileNames = new LinkedList<String>();
     }
 
 
     public FileOutputStreamFactory(String dir) {        
         this(dir, null);
-        fileNames = new LinkedList<Object>();
+        fileNames = new LinkedList<String>();
     }
 
 
@@ -182,7 +182,7 @@ public class FileOutputStreamFactory imp
     }
 
 
-    public Iterator getStreamNames() throws IOException {
+    public Iterator<String> getStreamNames() throws IOException {
         return fileNames.iterator();
     }
 

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/utils/OutputStreamFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/utils/OutputStreamFactory.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/utils/OutputStreamFactory.java (original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/utils/OutputStreamFactory.java Fri Jan  6 23:24:33 2012
@@ -45,7 +45,7 @@ public interface OutputStreamFactory {
         throws IOException;
 
 
-    Iterator getStreamNames() throws IOException;
+    Iterator<String> getStreamNames() throws IOException;
 
 
     void clearStreams();

Modified: cxf/trunk/tools/corba/src/test/java/org/apache/cxf/tools/corba/processors/WSDLToCorbaBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/test/java/org/apache/cxf/tools/corba/processors/WSDLToCorbaBindingTest.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/test/java/org/apache/cxf/tools/corba/processors/WSDLToCorbaBindingTest.java (original)
+++ cxf/trunk/tools/corba/src/test/java/org/apache/cxf/tools/corba/processors/WSDLToCorbaBindingTest.java Fri Jan  6 23:24:33 2012
@@ -45,6 +45,7 @@ import org.apache.cxf.binding.corba.wsdl
 import org.apache.cxf.binding.corba.wsdl.ParamType;
 import org.apache.cxf.binding.corba.wsdl.Sequence;
 import org.apache.cxf.binding.corba.wsdl.TypeMappingType;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.tools.corba.common.WSDLCorbaFactory;
 import org.apache.cxf.tools.corba.processors.wsdl.WSDLToCorbaBinding;
 import org.apache.cxf.tools.corba.processors.wsdl.WSDLToIDLAction;
@@ -141,7 +142,7 @@ public class WSDLToCorbaBindingTest exte
             tmap.put(type.getName(), type);
         }
         
-        Iterator j = binding.getBindingOperations().iterator();
+        Iterator<?> j = binding.getBindingOperations().iterator();
         while (j.hasNext()) {            
             BindingOperation bindingOperation = (BindingOperation)j.next();
             assertEquals("YCORBABinding", binding.getQName().getLocalPart());
@@ -161,9 +162,7 @@ public class WSDLToCorbaBindingTest exte
      
     private void checkSequenceType(BindingOperation bindingOperation,
                                    Map<String, CorbaTypeImpl> mapType) {
-        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;
                 assertEquals(corbaOpType.getName(), "op_h");
@@ -181,11 +180,9 @@ public class WSDLToCorbaBindingTest exte
     private void checkFixedTypeOne(BindingOperation bindingOperation,
                                    Map<String, CorbaTypeImpl>  mapType) {
 
-        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {
-            assertEquals(bindingOperation.getBindingInput().getName(), "op_k");
-            assertEquals(bindingOperation.getBindingOutput().getName(), "op_kResponse");
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+        assertEquals(bindingOperation.getBindingInput().getName(), "op_k");
+        assertEquals(bindingOperation.getBindingOutput().getName(), "op_kResponse");
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;
                 assertEquals(corbaOpType.getName(), "op_k");
@@ -205,9 +202,7 @@ public class WSDLToCorbaBindingTest exte
     
     private void checkFixedTypeTwo(BindingOperation bindingOperation,
                                    Map<String, CorbaTypeImpl>  mapType) {
-        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;
                 assertEquals(corbaOpType.getName(), "op_m");
@@ -226,9 +221,7 @@ public class WSDLToCorbaBindingTest exte
     
     private void checkFixedTypeThree(BindingOperation bindingOperation,
                                      Map<String, CorbaTypeImpl>  mapType) {
-        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();            
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;
                 assertEquals(corbaOpType.getName(), "op_n");
@@ -247,10 +240,7 @@ public class WSDLToCorbaBindingTest exte
     
     private void checkFixedTypeFour(BindingOperation bindingOperation,
                                     Map<String, CorbaTypeImpl>  mapType) {
-        Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
-      
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;
                 assertEquals(corbaOpType.getName(), "extended_op_m");
@@ -369,22 +359,20 @@ public class WSDLToCorbaBindingTest exte
         assertEquals(1, binding.getExtensibilityElements().size());
         assertEquals(1, binding.getBindingOperations().size());
         
-        Iterator i = binding.getExtensibilityElements().iterator();
-        while (i.hasNext()) {     
-            ExtensibilityElement extElement = (ExtensibilityElement)i.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(binding)) {
             if (extElement.getElementType().getLocalPart().equals("binding")) {
                 BindingType bindingType = (BindingType)extElement;
                 assertEquals(bindingType.getRepositoryID(), "IDL:TestException/ExceptionTest:1.0");
             }
         }        
-        Iterator j = binding.getBindingOperations().iterator();
+        Iterator<?> j = binding.getBindingOperations().iterator();
         while (j.hasNext()) {            
             BindingOperation bindingOperation = (BindingOperation)j.next();
             assertEquals(1, bindingOperation.getExtensibilityElements().size());
             assertEquals(bindingOperation.getBindingInput().getName(), "review_data");
             assertEquals(bindingOperation.getBindingOutput().getName(), "review_dataResponse");
             
-            Iterator f = bindingOperation.getBindingFaults().values().iterator();
+            Iterator<?> f = bindingOperation.getBindingFaults().values().iterator();
             boolean hasBadRecord = false;
             boolean hasMyException = false;
             while (f.hasNext()) {
@@ -400,9 +388,7 @@ public class WSDLToCorbaBindingTest exte
             assertTrue("Did not get expected TestException.BadRecord", hasBadRecord);
             assertTrue("Did not get expected MyException", hasMyException);
             
-            Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
-            while (bOp.hasNext()) {     
-                ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+            for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
                 if (extElement.getElementType().getLocalPart().equals("operation")) {
                     OperationType corbaOpType = (OperationType)extElement;                 
                     assertEquals(corbaOpType.getName(), "review_data");
@@ -444,25 +430,21 @@ public class WSDLToCorbaBindingTest exte
         assertEquals(1, binding.getExtensibilityElements().size());
         assertEquals(1, binding.getBindingOperations().size());
         
-        Iterator i = binding.getExtensibilityElements().iterator();
-        while (i.hasNext()) {     
-            ExtensibilityElement extElement = (ExtensibilityElement)i.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(binding)) {
             if (extElement.getElementType().getLocalPart().equals("binding")) {
                 BindingType bindingType = (BindingType)extElement;
                 assertEquals(bindingType.getRepositoryID(), "IDL:BasePortType:1.0");
             }
         }
         
-        Iterator j = binding.getBindingOperations().iterator();
+        Iterator<?> j = binding.getBindingOperations().iterator();
         while (j.hasNext()) {            
             BindingOperation bindingOperation = (BindingOperation)j.next();
             assertEquals(1, bindingOperation.getExtensibilityElements().size());
             assertEquals(bindingOperation.getBindingInput().getName(), "echoString");
             assertEquals(bindingOperation.getBindingOutput().getName(), "echoStringResponse");
             
-            Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
-            while (bOp.hasNext()) {     
-                ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+            for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
                 if (extElement.getElementType().getLocalPart().equals("operation")) {
                     OperationType corbaOpType = (OperationType)extElement;                 
                     assertEquals(corbaOpType.getName(), "echoString");
@@ -568,7 +550,7 @@ public class WSDLToCorbaBindingTest exte
         assertEquals(1, binding.getExtensibilityElements().size());
         assertEquals(32, binding.getBindingOperations().size());
         
-        List extElements = binding.getExtensibilityElements();             
+        List<ExtensibilityElement> extElements = getExtensibilityElements(binding);             
         ExtensibilityElement extElement = (ExtensibilityElement)extElements.get(0);
         if (extElement.getElementType().getLocalPart().equals("binding")) {
             BindingType bindingType = (BindingType)extElement;
@@ -612,9 +594,7 @@ public class WSDLToCorbaBindingTest exte
         assertEquals(1, bindingOp.getExtensibilityElements().size());
         assertEquals(bindingOp.getBindingInput().getName(), "_get_string_attribute");
         assertEquals(bindingOp.getBindingOutput().getName(), "_get_string_attributeResponse");
-        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {     
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOp)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;                 
                 assertEquals(corbaOpType.getName(), "_get_string_attribute");                
@@ -631,9 +611,7 @@ public class WSDLToCorbaBindingTest exte
         assertEquals(1, bindingOp.getExtensibilityElements().size());
         assertEquals(bindingOp.getBindingInput().getName(), "_get_test_id");
         assertEquals(bindingOp.getBindingOutput().getName(), "_get_test_idResponse");
-        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {     
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOp)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;                 
                 assertEquals(corbaOpType.getName(), "_get_test_id");                
@@ -650,9 +628,7 @@ public class WSDLToCorbaBindingTest exte
         assertEquals(1, bindingOp.getExtensibilityElements().size());
         assertEquals(bindingOp.getBindingInput().getName(), "_set_test_id");
         assertEquals(bindingOp.getBindingOutput().getName(), "_set_test_idResponse");
-        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {     
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOp)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;                 
                 assertEquals(corbaOpType.getName(), "_set_test_id");     
@@ -671,9 +647,7 @@ public class WSDLToCorbaBindingTest exte
         assertEquals(1, bindingOp.getExtensibilityElements().size());
         assertEquals(bindingOp.getBindingInput().getName(), "test_void");
         assertEquals(bindingOp.getBindingOutput().getName(), "test_voidResponse");
-        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {     
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOp)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;                 
                 assertEquals(corbaOpType.getName(), "test_void");     
@@ -689,9 +663,7 @@ public class WSDLToCorbaBindingTest exte
         assertEquals(1, bindingOp.getExtensibilityElements().size());
         assertEquals(bindingOp.getBindingInput().getName(), name);
         assertEquals(bindingOp.getBindingOutput().getName(), name + "Response");
-        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
-        while (bOp.hasNext()) {     
-            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+        for (ExtensibilityElement extElement : getExtensibilityElements(bindingOp)) {
             if (extElement.getElementType().getLocalPart().equals("operation")) {
                 OperationType corbaOpType = (OperationType)extElement;                 
                 assertEquals(corbaOpType.getName(), name);     
@@ -725,25 +697,21 @@ public class WSDLToCorbaBindingTest exte
             assertEquals(1, binding.getExtensibilityElements().size());
             assertEquals(1, binding.getBindingOperations().size());
 
-            Iterator i = binding.getExtensibilityElements().iterator();
-            while (i.hasNext()) {
-                ExtensibilityElement extElement = (ExtensibilityElement)i.next();
+            for (ExtensibilityElement extElement : getExtensibilityElements(binding)) {
                 if (extElement.getElementType().getLocalPart().equals("binding")) {
                     BindingType bindingType = (BindingType)extElement;
                     assertEquals(bindingType.getRepositoryID(), "IDL:X:1.0");
                 }
             }
 
-            Iterator j = binding.getBindingOperations().iterator();
+            Iterator<?> j = binding.getBindingOperations().iterator();
             while (j.hasNext()) {
                 BindingOperation bindingOperation = (BindingOperation)j.next();
                 assertEquals(1, bindingOperation.getExtensibilityElements().size());
                 assertEquals(bindingOperation.getBindingInput().getName(), "op_a");
                 assertEquals(bindingOperation.getBindingOutput().getName(), "op_aResponse");
 
-                Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
-                while (bOp.hasNext()) {
-                    ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
+                for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
                     if (extElement.getElementType().getLocalPart().equals("operation")) {
                         OperationType corbaOpType = (OperationType)extElement;
                         assertEquals(corbaOpType.getName(), "op_a");
@@ -772,4 +740,7 @@ public class WSDLToCorbaBindingTest exte
         }
     }
         
+    private List<ExtensibilityElement> getExtensibilityElements(javax.wsdl.extensions.ElementExtensible e) {
+        return CastUtils.cast(e.getExtensibilityElements());
+    }
 }

Modified: cxf/trunk/tools/corba/src/test/java/org/apache/cxf/tools/corba/processors/WSDLToCorbaBindingTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/test/java/org/apache/cxf/tools/corba/processors/WSDLToCorbaBindingTypeTest.java?rev=1228499&r1=1228498&r2=1228499&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/test/java/org/apache/cxf/tools/corba/processors/WSDLToCorbaBindingTypeTest.java (original)
+++ cxf/trunk/tools/corba/src/test/java/org/apache/cxf/tools/corba/processors/WSDLToCorbaBindingTypeTest.java Fri Jan  6 23:24:33 2012
@@ -23,7 +23,6 @@ import java.io.File;
 import java.net.URI;
 import java.net.URL;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -575,11 +574,9 @@ public class WSDLToCorbaBindingTypeTest 
 
             TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);
             assertEquals(5, mapType.getStructOrExceptionOrUnion().size());
-            Iterator i = mapType.getStructOrExceptionOrUnion().iterator();
             int strcnt = 0;
             int unioncnt = 0;
-            while (i.hasNext()) {
-                CorbaTypeImpl corbaType = (CorbaTypeImpl)i.next();
+            for (CorbaTypeImpl corbaType: mapType.getStructOrExceptionOrUnion()) {
                 if (corbaType instanceof Struct) {
                     strcnt++;
                 }



Mime
View raw message