cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: More code cleanup
Date Tue, 19 May 2015 10:45:08 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a23355b0f -> 894eef1d1


More code cleanup


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/894eef1d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/894eef1d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/894eef1d

Branch: refs/heads/master
Commit: 894eef1d106f702f19485a8c6b0147d8d2484677
Parents: a23355b
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue May 19 11:44:56 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue May 19 11:44:56 2015 +0100

----------------------------------------------------------------------
 .../server/NettyHttpServletPipelineFactory.java |  8 ++-
 .../org/apache/cxf/transport/http/Headers.java  |  8 +--
 .../cxf/transport/http/auth/HttpAuthHeader.java |  6 +--
 .../cxf/transport/jms/uri/JMSEndpoint.java      | 13 ++---
 .../StaxTransportBindingHandler.java            |  4 +-
 .../java/org/apache/cxf/wsdl11/SchemaUtil.java  |  7 ++-
 .../apache/cxf/wsdl11/ServiceWSDLBuilder.java   |  6 +--
 .../apache/cxf/wsdl11/WSDLServiceFactory.java   |  6 +--
 .../validator/internal/SchemaValidator.java     | 22 ++++----
 .../validator/internal/WSDL11Validator.java     | 29 ++++++-----
 .../validator/internal/WSDLRefValidator.java    | 11 ++--
 .../cxf/tools/wsdlto/WSDLToJavaContainer.java   | 53 +++++++++++---------
 .../wsdlto/core/WSDLDefinitionBuilder.java      |  5 +-
 .../customization/CustomizationParser.java      | 20 ++++----
 .../jaxws/generators/ImplGenerator.java         |  5 +-
 .../misc/processor/WSDLToServiceProcessor.java  | 22 ++++----
 .../misc/processor/WSDLToXMLProcessor.java      | 28 +++++------
 17 files changed, 130 insertions(+), 123 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
index d185aa8..4e42ec4 100644
--- a/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
+++ b/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/NettyHttpServletPipelineFactory.java
@@ -20,7 +20,6 @@
 package org.apache.cxf.transport.http.netty.server;
 
 import java.util.Map;
-import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -94,11 +93,10 @@ public class NettyHttpServletPipelineFactory extends ChannelInitializer<Channel>
     }
 
     public NettyHttpContextHandler getNettyHttpHandler(String url) {
-        Set<String> keySet = handlerMap.keySet();
-        for (String key : keySet) {
+        for (Map.Entry<String, NettyHttpContextHandler> entry : handlerMap.entrySet())
{
             // Here just check the context path first
-            if (url.startsWith(key)) {
-                return handlerMap.get(key);
+            if (url.startsWith(entry.getKey())) {
+                return entry.getValue();
             }
         }
         return null;

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
index 4fbcbc0..3afb67a 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
@@ -277,10 +277,10 @@ public class Headers {
      */
     void logProtocolHeaders(Level level) {
         if (LOG.isLoggable(level)) {
-            for (String header : headers.keySet()) {
-                List<?> headerList = headers.get(header);
-                for (Object value : headerList) {
-                    LOG.log(level, header + ": " 
+            for (Map.Entry<String, List<String>> entry : headers.entrySet())
{
+                List<String> headerList = entry.getValue();
+                for (String value : headerList) {
+                    LOG.log(level, entry.getKey() + ": " 
                         + (value == null ? "<null>" : value.toString()));
                 }
             }

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
index 5b32dbf..f9e96d9 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/HttpAuthHeader.java
@@ -78,13 +78,13 @@ public final class HttpAuthHeader {
     private String paramsToString() {
         StringBuilder builder = new StringBuilder();
         boolean first = true;
-        for (String key : params.keySet()) {
-            String param = params.get(key);
+        for (Map.Entry<String, String> entry : params.entrySet()) {
+            String param = entry.getValue();
             if (param != null) {
                 if (!first) {
                     builder.append(", ");
                 }
-                builder.append(key + "=\"" + param + "\"");
+                builder.append(entry.getKey() + "=\"" + param + "\"");
                 first = false;
             }
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
----------------------------------------------------------------------
diff --git a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
index 0de2066..1c7e126 100644
--- a/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
+++ b/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/uri/JMSEndpoint.java
@@ -155,11 +155,12 @@ public class JMSEndpoint {
      * @param params
      */
     private void configureProperties(Map<String, Object> params) {
-        for (String key : params.keySet()) {
-            Object value = params.get(key);
+        for (Map.Entry<String, Object> entry : params.entrySet()) {
+            Object value = entry.getValue();
             if (value == null || value.equals("")) {
                 continue;
             }
+            String key = entry.getKey();
             if (trySetProperty(key, value)) {
                 continue;
             }
@@ -190,13 +191,13 @@ public class JMSEndpoint {
         }
         requestUri.append(":" + destinationName);
         boolean first = true;
-        for (String key : parameters.keySet()) {
-            String value = parameters.get(key);
+        for (Map.Entry<String, String> entry : parameters.entrySet()) {
+            String value = entry.getValue();
             if (first) {
-                requestUri.append("?" + key + "=" + value);
+                requestUri.append("?" + entry.getKey() + "=" + value);
                 first = false;
             } else {
-                requestUri.append("&" + key + "=" + value);
+                requestUri.append("&" + entry.getKey() + "=" + value);
             }
         }
         return requestUri.toString();

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
index 21be9d0..9c35d2c 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/StaxTransportBindingHandler.java
@@ -222,8 +222,10 @@ public class StaxTransportBindingHandler extends AbstractStaxBindingHandler
{
                 addKerberosToken((KerberosToken)token, false, false, false);
             } else if (token instanceof SamlToken) {
                 addSamlToken((SamlToken)token, false, false);
-            } else {
+            } else if (token != null) {
                 throw new Exception(token.getName() + " is not supported in the streaming
code");
+            } else {
+                throw new Exception("A null token was supplied to the streaming code");
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
index 755581f..175b877 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java
@@ -198,10 +198,9 @@ public final class SchemaUtil {
 
         Map<String, List<?>> imports = CastUtils.cast(schema.getImports());
         if (imports != null && imports.size() > 0) {
-            Collection<String> importKeys = imports.keySet();
-            for (String importNamespace : importKeys) {
-
-                List<SchemaImport> schemaImports = CastUtils.cast(imports.get(importNamespace));
+            for (Map.Entry<String, List<?>> entry : imports.entrySet()) {
+                String importNamespace = entry.getKey();
+                List<SchemaImport> schemaImports = CastUtils.cast(entry.getValue());
                 
                 for (SchemaImport schemaImport : schemaImports) {
                     Schema tempImport = schemaImport.getReferencedSchema();             
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
index 743ac91..99b7698 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
@@ -274,9 +274,9 @@ public class ServiceWSDLBuilder {
         if (attributes == null) {
             return;
         }
-        for (QName qname : attributes.keySet()) {
-            addNamespace(qname.getNamespaceURI(), def);
-            attributeExtensible.setExtensionAttribute(qname, attributes.get(qname));
+        for (Map.Entry<QName, Object> entry : attributes.entrySet()) {
+            addNamespace(entry.getKey().getNamespaceURI(), def);
+            attributeExtensible.setExtensionAttribute(entry.getKey(), entry.getValue());
         }
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
----------------------------------------------------------------------
diff --git a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
index 1d998ae..be0d02e 100644
--- a/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
+++ b/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
@@ -136,10 +136,10 @@ public class WSDLServiceFactory extends AbstractServiceFactoryBean {
                         Map<QName, PortType> portTypes = CastUtils.cast(definition.getPortTypes());
                         String existPortName = null;
                         PortType portType = null;
-                        for (QName existPortQName : portTypes.keySet()) {
-                            existPortName = existPortQName.getLocalPart();
+                        for (Map.Entry<QName, PortType> entry : portTypes.entrySet())
{
+                            existPortName = entry.getKey().getLocalPart();
                             if (serviceName.getLocalPart().contains(existPortName)) {
-                                portType = portTypes.get(existPortQName);
+                                portType = entry.getValue();
                                 break;
                             }
                         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
----------------------------------------------------------------------
diff --git a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
index 09f65f0..fa7c3f7 100644
--- a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
+++ b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/SchemaValidator.java
@@ -247,19 +247,21 @@ public class SchemaValidator extends AbstractDefinitionValidator {
 
             File[] files = f.listFiles(filter);
 
-            List<String> xsdUrls = new ArrayList<String>(files.length);
-            for (File file : files) {
-                try {
-                    String s = file.toURI().toURL().toString();
-                    xsdUrls.add(s);
-                    if (s.contains("http-conf")) {
-                        xsdUrls.add(0, s);
+            if (files != null) {
+                List<String> xsdUrls = new ArrayList<String>(files.length);
+                for (File file : files) {
+                    try {
+                        String s = file.toURI().toURL().toString();
+                        xsdUrls.add(s);
+                        if (s.contains("http-conf")) {
+                            xsdUrls.add(0, s);
+                        }
+                    } catch (MalformedURLException e) {
+                        throw new ToolException(e);
                     }
-                } catch (MalformedURLException e) {
-                    throw new ToolException(e);
                 }
+                return xsdUrls.toArray(new String[xsdUrls.size()]);
             }
-            return xsdUrls.toArray(new String[xsdUrls.size()]);
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
----------------------------------------------------------------------
diff --git a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
index 4634019..406ab83 100644
--- a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
+++ b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
@@ -229,23 +229,26 @@ public class WSDL11Validator extends AbstractDefinitionValidator {
                 } catch (URISyntaxException e) {
                     //
                 }
-                java.io.File file = new java.io.File(loc);
-                if (file.exists()) {
-                    File[] files = file.listFiles(new FileFilter() {
-                            public boolean accept(File pathname) {
-                                if (pathname.getAbsolutePath().endsWith(".xsd")) {
-                                    return true;
+                if (loc != null) {
+                    java.io.File file = new java.io.File(loc);
+                    if (file.exists()) {
+                        File[] files = file.listFiles(new FileFilter() {
+                                public boolean accept(File pathname) {
+                                    if (pathname.getAbsolutePath().endsWith(".xsd")) {
+                                        return true;
+                                    }
+                                    return false;
                                 }
-                                return false;
+                            });
+                        if (files != null) {
+                            for (int i = 0; i < files.length; i++) {
+                                InputSource is = new InputSource(files[i].toURI().toURL().openStream());
+                                is.setSystemId(files[i].toURI().toURL().toString());
+                                xsdList.add(is);
                             }
-                        });
-                    for (int i = 0; i < files.length; i++) {
-                        InputSource is = new InputSource(files[i].toURI().toURL().openStream());
-                        is.setSystemId(files[i].toURI().toURL().toString());
-                        xsdList.add(is);
+                        }
                     }
                 }
-                
             }
         }
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
----------------------------------------------------------------------
diff --git a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
index 5cb7060..0c057f9 100644
--- a/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
+++ b/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDLRefValidator.java
@@ -137,11 +137,11 @@ public class WSDLRefValidator extends AbstractDefinitionValidator {
     private Collection<Import> getImports(final Definition wsdlDef) {
         Collection<Import> importList = new ArrayList<Import>();
         Map<?, ?> imports = wsdlDef.getImports();
-        for (Iterator<?> iter = imports.keySet().iterator(); iter.hasNext();) {
-            String uri = (String)iter.next();
-            List<Import> lst = CastUtils.cast((List<?>)imports.get(uri));
+        for (Map.Entry<?, ?> entry : imports.entrySet()) {
+            List<Import> lst = CastUtils.cast((List<?>)entry.getValue());
             importList.addAll(lst);
         }
+        
         return importList;
     }
     private void parseImports(Definition def) {
@@ -415,7 +415,8 @@ public class WSDLRefValidator extends AbstractDefinitionValidator {
             vBindingNodes.putAll(getBindings(service));
         }
 
-        for (QName bName : vBindingNodes.keySet()) {
+        for (Map.Entry<QName, XNode> entry : vBindingNodes.entrySet()) {
+            QName bName = entry.getKey();
             Binding binding = this.definition.getBinding(bName);
             if (binding == null) {
                 LOG.log(Level.SEVERE, bName.toString() 
@@ -424,7 +425,7 @@ public class WSDLRefValidator extends AbstractDefinitionValidator {
                         + " is not correct, please check that the correct namespace is being
used");
             }
             XNode vBindingNode = getXNode(binding);
-            vBindingNode.setFailurePoint(vBindingNodes.get(bName));
+            vBindingNode.setFailurePoint(entry.getValue());
             vNodes.add(vBindingNode);
 
             if (binding.getPortType() == null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
b/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
index 1ba192a..dac902f 100644
--- a/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
+++ b/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/WSDLToJavaContainer.java
@@ -370,29 +370,32 @@ public class WSDLToJavaContainer extends AbstractCXFToolContainer {
     private void createClientJar(File tmpDirectory, JarOutputStream jarout) {
         try {
             URI parentFile = new File((String)context.get(ToolConstants.CFG_CLASSDIR)).toURI();
-            for (File file : tmpDirectory.listFiles()) {
-                URI relativePath = parentFile.relativize(file.toURI());
-                String name = relativePath.toString();
-                if (file.isDirectory()) {
-                    if (!StringUtils.isEmpty(name)) {
-                        if (!name.endsWith("/")) {
-                            name += "/";
+            File[] files = tmpDirectory.listFiles();
+            if (files != null) {
+                for (File file : files) {
+                    URI relativePath = parentFile.relativize(file.toURI());
+                    String name = relativePath.toString();
+                    if (file.isDirectory()) {
+                        if (!StringUtils.isEmpty(name)) {
+                            if (!name.endsWith("/")) {
+                                name += "/";
+                            }
+                            JarEntry entry = new JarEntry(name);
+                            entry.setTime(file.lastModified());
+                            jarout.putNextEntry(entry);
+                            jarout.closeEntry();
                         }
-                        JarEntry entry = new JarEntry(name);
-                        entry.setTime(file.lastModified());
-                        jarout.putNextEntry(entry);
-                        jarout.closeEntry();
+                        createClientJar(file, jarout);
+                        continue;
                     }
-                    createClientJar(file, jarout);
-                    continue;
+                    JarEntry entry = new JarEntry(name);
+                    entry.setTime(file.lastModified());
+                    jarout.putNextEntry(entry);
+                    InputStream input = new BufferedInputStream(new FileInputStream(file));
+                    IOUtils.copy(input, jarout);
+                    input.close();
+                    jarout.closeEntry();
                 }
-                JarEntry entry = new JarEntry(name);
-                entry.setTime(file.lastModified());
-                jarout.putNextEntry(entry);
-                InputStream input = new BufferedInputStream(new FileInputStream(file));
-                IOUtils.copy(input, jarout);
-                input.close();
-                jarout.closeEntry();
             }
         } catch (Exception e) {
             Message msg = new Message("FAILED_ADD_JARENTRY", LOG);
@@ -618,9 +621,8 @@ public class WSDLToJavaContainer extends AbstractCXFToolContainer {
     protected void setLibraryReferences(ToolContext env) {
         Properties props = loadProperties(getResourceAsStream("wsdltojavalib.properties"));
         if (props != null) {
-            for (Iterator<?> keys = props.keySet().iterator(); keys.hasNext();) {
-                String key = (String)keys.next();
-                env.put(key, props.get(key));
+            for (Map.Entry<Object, Object> entry : props.entrySet()) {
+                env.put((String)entry.getKey(), entry.getValue());
             }
         }
         env.put(ToolConstants.CFG_ANT_PROP, props);
@@ -677,7 +679,7 @@ public class WSDLToJavaContainer extends AbstractCXFToolContainer {
             file.delete();
             File tmpFile = file.getParentFile();
             while (tmpFile != null && !tmpFile.getCanonicalPath().equalsIgnoreCase(outPutDir))
{
-                if (tmpFile.isDirectory() && tmpFile.list().length == 0) {
+                if (tmpFile.isDirectory() && tmpFile.list() != null && tmpFile.list().length
== 0) {
                     tmpFile.delete();
                 }
                 tmpFile = tmpFile.getParentFile();
@@ -691,7 +693,8 @@ public class WSDLToJavaContainer extends AbstractCXFToolContainer {
                 classFile.delete();
                 File tmpClzFile = classFile.getParentFile();
                 while (tmpClzFile != null && !tmpClzFile.getCanonicalPath().equalsIgnoreCase(outPutDir))
{
-                    if (tmpClzFile.isDirectory() && tmpClzFile.list().length == 0)
{
+                    if (tmpClzFile.isDirectory() && tmpClzFile.list() != null 
+                        && tmpClzFile.list().length == 0) {
                         tmpClzFile.delete();
                     }
                     tmpClzFile = tmpClzFile.getParentFile();

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLDefinitionBuilder.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLDefinitionBuilder.java
b/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLDefinitionBuilder.java
index 34efe20..409e29f 100644
--- a/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLDefinitionBuilder.java
+++ b/tools/wsdlto/core/src/main/java/org/apache/cxf/tools/wsdlto/core/WSDLDefinitionBuilder.java
@@ -103,9 +103,8 @@ public class WSDLDefinitionBuilder implements WSDLBuilder<Definition>
{
     public static Collection<Import> getImports(final Definition wsdlDef) {
         Collection<Import> importList = new ArrayList<Import>();
         Map<?, ?> imports = wsdlDef.getImports();
-        for (Iterator<?> iter = imports.keySet().iterator(); iter.hasNext();) {
-            String uri = (String)iter.next();
-            List<Import> lst = CastUtils.cast((List<?>)imports.get(uri));
+        for (Map.Entry<?, ?> entry : imports.entrySet()) {
+            List<Import> lst = CastUtils.cast((List<?>)entry.getValue());
             importList.addAll(lst);
         }
         return importList;

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
index fbac01b..b7f77b9 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
@@ -119,12 +119,12 @@ public final class CustomizationParser {
             }
         }
 
-        for (Element element : jaxwsBindingsMap.keySet()) {
-            nodeSelector.addNamespaces(element);
-            Element oldTargetNode = jaxwsBindingsMap.get(element);
+        for (Map.Entry<Element, Element> entry : jaxwsBindingsMap.entrySet()) {
+            nodeSelector.addNamespaces(entry.getKey());
+            Element oldTargetNode = entry.getValue();
             Element targetNode = oldTargetNode;
-            internalizeBinding(element, targetNode, "");
-            String uri = element.getAttribute("wsdlLocation");
+            internalizeBinding(entry.getKey(), targetNode, "");
+            String uri = entry.getKey().getAttribute("wsdlLocation");
             customizedElements.put(uri, targetNode);
             updateJaxwsBindingMapValue(targetNode);  
         }
@@ -185,13 +185,13 @@ public final class CustomizationParser {
     }
 
     private void updateJaxwsBindingMapValue(Element value) {
-        String baseURI = value.getBaseURI();        
-        for (Element ele : jaxwsBindingsMap.keySet()) {
-            String uri = jaxwsBindingsMap.get(ele).getBaseURI();
+        String baseURI = value.getBaseURI();
+        for (Map.Entry<Element, Element> entry : jaxwsBindingsMap.entrySet()) {
+            String uri = entry.getValue().getBaseURI();
             if (uri != null && uri.equals(baseURI)) {
-                jaxwsBindingsMap.put(ele, value);
+                jaxwsBindingsMap.put(entry.getKey(), value);
             }
-        }      
+        }
     }
     
     private void buildHandlerChains() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
index 77137df..2478cd6 100644
--- a/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
+++ b/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/generators/ImplGenerator.java
@@ -76,9 +76,8 @@ public class ImplGenerator extends AbstractJAXWSGenerator {
                     }
                 }
             } else {
-                for (String interfaceName : interfaces.keySet()) {
-                    JavaInterface intf = interfaces.get(interfaceName);
-                    outputImpl(intf, null, "", penv);
+                for (Map.Entry<String, JavaInterface> entry : interfaces.entrySet())
{
+                    outputImpl(entry.getValue(), null, "", penv);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java
b/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java
index 0376b61..d5beb0d 100644
--- a/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java
+++ b/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToServiceProcessor.java
@@ -72,10 +72,10 @@ public class WSDLToServiceProcessor extends AbstractWSDLToProcessor {
         if (services == null) {
             return false;
         }
-        for (QName serviceQName : services.keySet()) {
-            String serviceName = serviceQName.getLocalPart();
+        for (Map.Entry<QName, Service> entry : services.entrySet()) {
+            String serviceName = entry.getKey().getLocalPart();
             if (serviceName.equals(env.get(ToolConstants.CFG_SERVICE))) {
-                service = services.get(serviceQName);
+                service = entry.getValue();
                 break;
             }
         }
@@ -87,9 +87,9 @@ public class WSDLToServiceProcessor extends AbstractWSDLToProcessor {
         if (ports == null) {
             return false;
         }
-        for (String portName : ports.keySet()) {
-            if (portName.equals(env.get(ToolConstants.CFG_PORT))) {
-                port = ports.get(portName);
+        for (Map.Entry<String, Port> entry : ports.entrySet()) {
+            if (entry.getKey().equals(env.get(ToolConstants.CFG_PORT))) {
+                port = entry.getValue();
                 break;
             }
         }
@@ -101,11 +101,11 @@ public class WSDLToServiceProcessor extends AbstractWSDLToProcessor
{
         if (bindings == null) {
             return false;
         }
-        for (QName bindingQName : bindings.keySet()) {
-            String bindingName = bindingQName.getLocalPart();
+        for (Map.Entry<QName, Binding> entry : bindings.entrySet()) {
+            String bindingName = entry.getKey().getLocalPart();
             String attrBinding = (String)env.get(ToolConstants.CFG_BINDING_ATTR);
             if (attrBinding.equals(bindingName)) {
-                binding = bindings.get(bindingQName);
+                binding = entry.getValue();
             }
         }
         return (binding == null) ? false : true;
@@ -152,8 +152,8 @@ public class WSDLToServiceProcessor extends AbstractWSDLToProcessor {
         Address address = AddressFactory.getInstance().getAddresser(transport);
 
         Map<String, String> ns = address.getNamespaces(env);
-        for (String key : ns.keySet()) {
-            wsdlDefinition.addNamespace(key, ns.get(key));
+        for (Map.Entry<String, String> entry : ns.entrySet()) {
+            wsdlDefinition.addNamespace(entry.getKey(), entry.getValue());
         }
 
         WSDLExtensibilityPlugin plugin = getWSDLPlugin(transport, Port.class);

http://git-wip-us.apache.org/repos/asf/cxf/blob/894eef1d/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
----------------------------------------------------------------------
diff --git a/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
b/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
index b574190..102ab2f 100644
--- a/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
+++ b/tools/wsdlto/misc/src/main/java/org/apache/cxf/tools/misc/processor/WSDLToXMLProcessor.java
@@ -90,10 +90,10 @@ public class WSDLToXMLProcessor extends AbstractWSDLToProcessor {
         if (services == null) {
             return false;
         }
-        for (QName serviceQName : services.keySet()) {
-            String serviceName = serviceQName.getLocalPart();
+        for (Map.Entry<QName, Service> entry : services.entrySet()) {
+            String serviceName = entry.getKey().getLocalPart();
             if (serviceName.equals(env.get(ToolConstants.CFG_SERVICE))) {
-                service = services.get(serviceQName);
+                service = entry.getValue();
                 break;
             }
         }
@@ -105,9 +105,9 @@ public class WSDLToXMLProcessor extends AbstractWSDLToProcessor {
         if (ports == null) {
             return false;
         }
-        for (String portName : ports.keySet()) {
-            if (portName.equals(env.get(ToolConstants.CFG_PORT))) {
-                port = ports.get(portName);
+        for (Map.Entry<String, Port> entry : ports.entrySet()) {
+            if (entry.getKey().equals(env.get(ToolConstants.CFG_PORT))) {
+                port = entry.getValue();
                 break;
             }
         }
@@ -119,10 +119,10 @@ public class WSDLToXMLProcessor extends AbstractWSDLToProcessor {
         if (portTypes == null) {
             return false;
         }
-        for (QName existPortQName : portTypes.keySet()) {
-            String existPortName = existPortQName.getLocalPart();
+        for (Map.Entry<QName, PortType> entry : portTypes.entrySet()) {
+            String existPortName = entry.getKey().getLocalPart();
             if (existPortName.equals(env.get(ToolConstants.CFG_PORTTYPE))) {
-                portType = portTypes.get(existPortQName);
+                portType = entry.getValue();
                 break;
             }
         }
@@ -134,11 +134,11 @@ public class WSDLToXMLProcessor extends AbstractWSDLToProcessor {
         if (bindings == null) {
             return false;
         }
-        for (QName existBindingQName : bindings.keySet()) {
-            String existBindingName = existBindingQName.getLocalPart();
+        for (Map.Entry<QName, Binding> entry : bindings.entrySet()) {
+            String existBindingName = entry.getKey().getLocalPart();
             String bindingName = (String)env.get(ToolConstants.CFG_BINDING);
             if (bindingName.equals(existBindingName)) {
-                binding = bindings.get(existBindingQName);
+                binding = entry.getValue();
             }
         }
         return (binding == null) ? false : true;
@@ -253,8 +253,8 @@ public class WSDLToXMLProcessor extends AbstractWSDLToProcessor {
     private void setAddrElement() throws ToolException {
         Address address = AddressFactory.getInstance().getAddresser("xml");
 
-        for (String key : address.getNamespaces(env).keySet()) {
-            wsdlDefinition.addNamespace(key, address.getNamespaces(env).get(key));
+        for (Map.Entry<String, String> entry : address.getNamespaces(env).entrySet())
{
+            wsdlDefinition.addNamespace(entry.getKey(), entry.getValue());
         }
 
         WSDLExtensibilityPlugin generator = getWSDLPlugin("xml", Port.class);


Mime
View raw message