cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1409896 - in /cxf/trunk: api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/resource/ rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/inter...
Date Thu, 15 Nov 2012 17:42:15 GMT
Author: coheigea
Date: Thu Nov 15 17:42:11 2012
New Revision: 1409896

URL: http://svn.apache.org/viewvc?rev=1409896&view=rev
Log:
More code cleanup

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
    cxf/trunk/api/src/main/java/org/apache/cxf/resource/URIResolver.java
    cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java
    cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
    cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamOutEndingInterceptor.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
    cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
    cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
    cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationProvider.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/SimpleTypeSpecVisitor.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TemplateTypeSpecVisitor.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypeDclVisitor.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypedefVisitor.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLParameter.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java
    cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java Thu Nov
15 17:42:11 2012
@@ -130,7 +130,7 @@ public abstract class AbstractConduitSel
             }
             conduits.add(c);
         } 
-        if (c.getTarget() != null && c.getTarget().getAddress() != null) {
+        if (c != null && c.getTarget() != null && c.getTarget().getAddress()
!= null) {
             replaceEndpointAddressPropertyIfNeeded(message, c.getTarget().getAddress().getValue(),
c);
         }
         //the search for the conduit could cause extra properties to be reset/loaded. 

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/resource/URIResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/resource/URIResolver.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/resource/URIResolver.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/resource/URIResolver.java Thu Nov 15 17:42:11
2012
@@ -277,7 +277,10 @@ public class URIResolver {
         }
         
         // decode spaces before returning otherwise File.exists returns false 
-        return path.replace("%20", " ");
+        if (path != null) {
+            return path.replace("%20", " ");
+        }
+        return null;
     }
 
     private void tryArchive(String baseStr, String uriStr) throws IOException {

Modified: cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java
(original)
+++ cxf/trunk/rt/bindings/coloc/src/main/java/org/apache/cxf/binding/coloc/ColocMessageObserver.java
Thu Nov 15 17:42:11 2012
@@ -163,7 +163,9 @@ public class ColocMessageObserver extend
         
         exchange.put(BindingInfo.class, bi);
         exchange.put(BindingOperationInfo.class, boi);
-        exchange.put(OperationInfo.class, boi.getOperationInfo());
+        if (boi != null) {
+            exchange.put(OperationInfo.class, boi.getOperationInfo());
+        }
     }
     
     protected List<Interceptor<? extends Message>> addColocInterceptors() {

Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamInInterceptor.java
Thu Nov 15 17:42:11 2012
@@ -325,11 +325,11 @@ public class CorbaStreamInInterceptor ex
     protected QName getMessageParamQName(MessageInfo msgInfo,
                                          String paramName,
                                          int index) {
-        QName paramQName;
+        QName paramQName = null;
         MessagePartInfo part = msgInfo.getMessageParts().get(index);
         if (part != null && part.isElement()) {
             paramQName = part.getElementQName();
-        } else {
+        } else if (part != null) {
             paramQName = part.getName();
         }
         return paramQName;

Modified: cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamOutEndingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamOutEndingInterceptor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamOutEndingInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/main/java/org/apache/cxf/binding/corba/interceptors/CorbaStreamOutEndingInterceptor.java
Thu Nov 15 17:42:11 2012
@@ -213,11 +213,11 @@ public class CorbaStreamOutEndingInterce
     protected QName getMessageParamQName(MessageInfo msgInfo,
                                          String paramName,
                                          int index) {
-        QName paramQName;
+        QName paramQName = null;
         MessagePartInfo part = msgInfo.getMessageParts().get(index);
         if (part != null && part.isElement()) {
             paramQName = part.getElementQName();
-        } else {
+        } else if (part != null)  {
             paramQName = part.getName();
         }
         return paramQName;

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/basic/ObjectType.java
Thu Nov 15 17:42:11 2012
@@ -94,7 +94,10 @@ public class ObjectType extends AegisTyp
             throw new DatabindingException("Missing 'xsi:type' attribute");
         }
 
-        String typeName = typeReader.getValue();
+        String typeName = null;
+        if (typeReader != null) {
+            typeName = typeReader.getValue();
+        }
 
         if (null == typeName && !readToDocument) {
             throw new DatabindingException("Missing 'xsi:type' attribute value");

Modified: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java
(original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansSchemaTypeUtils.java
Thu Nov 15 17:42:11 2012
@@ -96,9 +96,9 @@ public final class XMLBeansSchemaTypeUti
                 schemaType = schemaType.getBaseType();
             }
         }
-        if (schemaType.isBuiltinType()) {
+        if (schemaType != null && schemaType.isBuiltinType()) {
             result = BUILTIN_TYPES_MAP.get(schemaType.getFullJavaName());
-        } else {
+        } else if (schemaType != null) {
             result = schemaType.getFullJavaName().replace('$', '.');
         }        
         return result;

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
Thu Nov 15 17:42:11 2012
@@ -92,10 +92,13 @@ public class SwAOutInterceptor extends A
             }
         }
         try {
-            return (Boolean)m.invoke(ctx);
+            if (m != null) {
+                return (Boolean)m.invoke(ctx);
+            }
         } catch (Exception e) {
-            return false;
+            //ignore
         }
+        return false;
     }
 
     public void handleMessage(SoapMessage message) throws Fault {

Modified: cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
(original)
+++ cxf/trunk/rt/management/src/main/java/org/apache/cxf/management/interceptor/AbstractMessageResponseTimeInterceptor.java
Thu Nov 15 17:42:11 2012
@@ -91,7 +91,7 @@ public abstract class AbstractMessageRes
         Bus bus = ex.get(Bus.class);
         if (null == bus) {
             LOG.log(Level.INFO, "CAN_NOT_GET_BUS_FROM_EXCHANGE");
-            BusFactory.getThreadDefaultBus();
+            bus = BusFactory.getThreadDefaultBus();
         }
         
         Message message = ex.getOutMessage();

Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationProvider.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationProvider.java
(original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/continuations/JettyContinuationProvider.java
Thu Nov 15 17:42:11 2012
@@ -49,7 +49,7 @@ public class JettyContinuationProvider i
         if (m != null && m.getExchange() != null && m.getExchange().getInMessage()
!= null) {
             m = m.getExchange().getInMessage();
         }
-        if (m.getExchange().isOneWay()) {
+        if (m == null || m.getExchange() == null || m.getExchange().isOneWay()) {
             return null;
         }        
         if (wrapper == null && create) {

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java
(original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/continuations/JMSContinuationProvider.java
Thu Nov 15 17:42:11 2012
@@ -58,7 +58,7 @@ public class JMSContinuationProvider imp
         if (m != null && m.getExchange() != null && m.getExchange().getInMessage()
!= null) {
             m = m.getExchange().getInMessage();
         }
-        if (m.getExchange().isOneWay()) {
+        if (m == null || m.getExchange() == null || m.getExchange().isOneWay()) {
             return null;
         }
         JMSContinuation cw = m.get(JMSContinuation.class);

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
Thu Nov 15 17:42:11 2012
@@ -93,9 +93,11 @@ public final class EHCacheManagerHolder 
 
         String defaultConfigFile = "cxf-ehcache.xml";
         URL configFileURL = null;
+        String busId = "";
         if (bus != null) {
             ResourceManager rm = bus.getExtension(ResourceManager.class);
             configFileURL = rm.resolveResource(defaultConfigFile, URL.class);
+            busId = bus.getId();
         }
         try {
             if (configFileURL == null) {
@@ -117,10 +119,10 @@ public final class EHCacheManagerHolder 
             }
             if (Boolean.parseBoolean(perBus)) {
             */
-            conf.setName(bus.getId());
+            conf.setName(busId);
             if ("java.io.tmpdir".equals(conf.getDiskStoreConfiguration().getOriginalPath()))
{
                 String path = conf.getDiskStoreConfiguration().getPath() + File.separator
-                    + bus.getId();
+                    + busId;
                 conf.getDiskStoreConfiguration().setPath(path);
             }
             return CacheManager.create(conf);

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java
(original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/model/JavaInterface.java
Thu Nov 15 17:42:11 2012
@@ -243,7 +243,9 @@ public class JavaInterface implements Ja
             return;
         }
         // replace "$" with "." to correctly deal with member classes
-        imports.add(i.replaceAll("\\$", "\\."));
+        if (i != null) {
+            imports.add(i.replaceAll("\\$", "\\."));
+        }
     }
     
     public void addImports(Collection<String> ii) {

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/SimpleTypeSpecVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/SimpleTypeSpecVisitor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/SimpleTypeSpecVisitor.java
(original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/SimpleTypeSpecVisitor.java
Thu Nov 15 17:42:11 2012
@@ -71,11 +71,12 @@ public class SimpleTypeSpecVisitor exten
         
         }
         
-        
-        visitor.visit(node);
+        if (visitor != null) {
+            visitor.visit(node);
 
-        setSchemaType(visitor.getSchemaType());
-        setCorbaType(visitor.getCorbaType());
-        setFullyQualifiedName(visitor.getFullyQualifiedName());
+            setSchemaType(visitor.getSchemaType());
+            setCorbaType(visitor.getCorbaType());
+            setFullyQualifiedName(visitor.getFullyQualifiedName());
+        }
     }
 }

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TemplateTypeSpecVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TemplateTypeSpecVisitor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TemplateTypeSpecVisitor.java
(original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TemplateTypeSpecVisitor.java
Thu Nov 15 17:42:11 2012
@@ -65,11 +65,13 @@ public class TemplateTypeSpecVisitor ext
             visitor = new FixedVisitor(getScope(), definition, schema, wsdlVisitor, identifierNode);
         }
 
-        visitor.visit(node);
+        if (visitor != null) {
+            visitor.visit(node);
 
-        setSchemaType(visitor.getSchemaType());
-        setCorbaType(visitor.getCorbaType());
-        setFullyQualifiedName(visitor.getFullyQualifiedName());
+            setSchemaType(visitor.getSchemaType());
+            setCorbaType(visitor.getCorbaType());
+            setFullyQualifiedName(visitor.getFullyQualifiedName());
+        }
     }
 
 }

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypeDclVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypeDclVisitor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypeDclVisitor.java
(original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypeDclVisitor.java
Thu Nov 15 17:42:11 2012
@@ -79,7 +79,9 @@ public class TypeDclVisitor extends Visi
 
         // TODO forward declaration <constr_forward_declaration>
         
-        visitor.visit(node);
+        if (visitor != null) {
+            visitor.visit(node);
+        }      
     }
 
 }

Modified: cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypedefVisitor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypedefVisitor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypedefVisitor.java
(original)
+++ cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/TypedefVisitor.java
Thu Nov 15 17:42:11 2012
@@ -157,9 +157,10 @@ public class TypedefVisitor extends Visi
         // corba:alias
         Alias alias = new Alias();
         alias.setQName(new QName(typeMap.getTargetNamespace(), scopedName.toString()));
-        if (corbaType != null || schemaType != null) {
+        if (corbaType != null) {
             alias.setBasetype(corbaType.getQName());
-        } else {
+        // if (schemaType == null) might not be correct here
+        } else if (schemaType == null) {
             wsdlVisitor.getDeferredActions().
                 add(fqName, new TypedefDeferredAction(alias));
             scopedNames.add(scopedName);         

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=1409896&r1=1409895&r2=1409896&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
Thu Nov 15 17:42:11 2012
@@ -90,10 +90,13 @@ public final class WSDLParameter {
             Message msg = input.getMessage();
             Part part = (Part)msg.getOrderedParts(null).iterator().next();
 
-            XmlSchemaComplexType schemaType = null;
-
             XmlSchemaElement el = getElement(part, xmlSchemaList);
-            if ((el != null) && (el.getSchemaType() != null)) {
+            if (el == null) {
+                return;
+            }
+
+            XmlSchemaComplexType schemaType = null;
+            if (el.getSchemaType() != null) {
                 schemaType = (XmlSchemaComplexType)el.getSchemaType();
             }
 
@@ -133,17 +136,19 @@ public final class WSDLParameter {
                 boolean isObjectRef = isObjectReference(xmlSchemaList, part.getElementName());
                 if (part.getElementName() != null && !isObjectRef) {
                     XmlSchemaElement el = getElement(part, xmlSchemaList);
-                    if ((el != null) && (el.getSchemaType() != null)) {
-                        schemaType = el.getSchemaType();
-                    }
-                    QName typeName = el.getSchemaTypeName();
-                    if (typeName == null) {
-                        typeName = el.getQName();
-                    }
-                    QName idltype = getIdlType(wsdlToCorbaBinding, schemaType, typeName,
el.isNillable());
-                    ParamType paramtype = createParam(wsdlToCorbaBinding, "in", part.getName(),
idltype);
-                    if (paramtype != null) {
-                        inputs.add(paramtype);
+                    if (el != null) {
+                        if (el.getSchemaType() != null) {
+                            schemaType = el.getSchemaType();
+                        }
+                        QName typeName = el.getSchemaTypeName();
+                        if (typeName == null) {
+                            typeName = el.getQName();
+                        }
+                        QName idltype = getIdlType(wsdlToCorbaBinding, schemaType, typeName,
el.isNillable());
+                        ParamType paramtype = createParam(wsdlToCorbaBinding, "in", part.getName(),
idltype);
+                        if (paramtype != null) {
+                            inputs.add(paramtype);
+                        }
                     }
                 } else if (part.getTypeName() != null) {
                     schemaType = getType(part, xmlSchemaList);
@@ -173,7 +178,10 @@ public final class WSDLParameter {
             XmlSchemaComplexType schemaType = null;
 
             XmlSchemaElement el = getElement(part, xmlSchemaList);
-            if (el != null && el.getSchemaType() != null) {
+            if (el == null) {
+                return;
+            }
+            if (el.getSchemaType() != null) {
                 schemaType = (XmlSchemaComplexType)el.getSchemaType();
             }
             XmlSchemaSequence seq = (XmlSchemaSequence)schemaType.getParticle();
@@ -238,18 +246,20 @@ public final class WSDLParameter {
                     ParamType d2 = inputs.get(x);
                     if (part.getElementName() != null && !isObjectRef) {
                         XmlSchemaElement el = getElement(part, xmlSchemaList);
-                        if (el != null && el.getSchemaType() != null) {
-                            schemaType = el.getSchemaType();
-                        }
-                        QName typeName = el.getSchemaTypeName();
-                        if (typeName == null) {
-                            typeName = el.getQName();
-                        }
-                        QName idltype = getIdlType(wsdlToCorbaBinding, schemaType, typeName,
el.isNillable());
-                        if ((d2.getName().equals(part.getName())) && (d2.getIdltype().equals(idltype)))
{
-                            inputs.remove(x);
-                            paramtype = createParam(wsdlToCorbaBinding, "inout", part.getName(),
idltype);
-                            inputs.add(paramtype);
+                        if (el != null) {
+                            if (el.getSchemaType() != null) {
+                                schemaType = el.getSchemaType();
+                            }
+                            QName typeName = el.getSchemaTypeName();
+                            if (typeName == null) {
+                                typeName = el.getQName();
+                            }
+                            QName idltype = getIdlType(wsdlToCorbaBinding, schemaType, typeName,
el.isNillable());
+                            if ((d2.getName().equals(part.getName())) && (d2.getIdltype().equals(idltype)))
{
+                                inputs.remove(x);
+                                paramtype = createParam(wsdlToCorbaBinding, "inout", part.getName(),
idltype);
+                                inputs.add(paramtype);
+                            }
                         }
                     } else {
                         schemaType = getType(part, xmlSchemaList);

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=1409896&r1=1409895&r2=1409896&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
Thu Nov 15 17:42:11 2012
@@ -1082,9 +1082,11 @@ public class WSDLToCorbaHelper {
         }
 
         //Deal with Attributes defined in Extension
-        for (int i = 0; i < attrMembers.size(); i++) {
-            MemberType member = attrMembers.get(i);
-            corbaStruct.getMember().add(member);
+        if (attrMembers != null) {
+            for (int i = 0; i < attrMembers.size(); i++) {
+                MemberType member = attrMembers.get(i);
+                corbaStruct.getMember().add(member);
+            }
         }
 
         return corbaStruct;

Modified: cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
(original)
+++ cxf/trunk/tools/validator/src/main/java/org/apache/cxf/tools/validator/internal/WSDL11Validator.java
Thu Nov 15 17:42:11 2012
@@ -255,7 +255,11 @@ public class WSDL11Validator extends Abs
     private void sort(List<InputSource> list) {
         Collections.sort(list, new Comparator<InputSource>() {
             public int compare(InputSource i1, InputSource i2) {
-                if (i1 == null && i2 == null) {
+                if (i1 == null && i2 != null) {
+                    return -1;
+                } else if (i1 != null && i2 == null) {
+                    return 1;
+                } else if (i1 == null && i2 == null) {
                     return -1;
                 }
                 return i1.getSystemId().compareTo(i2.getSystemId());

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Thu Nov 15 17:42:11 2012
@@ -441,7 +441,9 @@ public final class CustomizationParser {
             elem = DOMUtils.getNextElement(elem);       
         }
 
-        firstChild.appendChild(cloneNode);
+        if (firstChild != null) {
+            firstChild.appendChild(cloneNode);
+        }
     }
 
     private boolean isGlobaleBindings(Element binding) {

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java?rev=1409896&r1=1409895&r2=1409896&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
Thu Nov 15 17:42:11 2012
@@ -452,10 +452,11 @@ public class ServiceProcessor extends Ab
         List<ExtensibilityElement> inbindings = null;
         if (operation.getInput() != null) {
             inbindings = operation.getInput().getExtensors(ExtensibilityElement.class);
-            if (inbindings == null) {
-                inbindings = new ArrayList<ExtensibilityElement>();
-            }
         }
+        if (inbindings == null) {
+            inbindings = new ArrayList<ExtensibilityElement>();
+        }
+
         String use = null;
         for (ExtensibilityElement ext : inbindings) {
             if (SOAPBindingUtil.isSOAPBody(ext)) {



Mime
View raw message