cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1402099 - in /cxf/trunk: api/src/main/java/org/apache/cxf/transport/ api/src/main/java/org/apache/cxf/ws/addressing/ rt/core/src/main/java/org/apache/cxf/bus/extension/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/ rt/...
Date Thu, 25 Oct 2012 10:53:27 GMT
Author: coheigea
Date: Thu Oct 25 10:53:26 2012
New Revision: 1402099

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

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
    cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
    cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/idl/ScopedNameVisitor.java
    cxf/trunk/tools/corba/src/main/java/org/apache/cxf/tools/corba/processors/wsdl/WSDLToCorbaHelper.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java Thu
Oct 25 10:53:26 2012
@@ -153,13 +153,13 @@ public class ChainInitiationObserver imp
     
     protected void setExchangeProperties(Exchange exchange, Message m) {
         exchange.put(Endpoint.class, endpoint);
-        exchange.put(Service.class, endpoint.getService());
         exchange.put(Binding.class, getBinding());
         exchange.put(Bus.class, bus);
         if (exchange.getDestination() == null) {
             exchange.setDestination(m.getDestination());
         }
         if (endpoint != null && endpoint.getService() != null) {
+            exchange.put(Service.class, endpoint.getService());
 
             EndpointInfo endpointInfo = endpoint.getEndpointInfo();
 
@@ -185,7 +185,9 @@ public class ChainInitiationObserver imp
                 }
                 exchange.put(Message.WSDL_DESCRIPTION, wsdlDescription);
             }
-        }  
+        } else {
+            exchange.put(Service.class, null);
+        }
     }
 
     public Endpoint getEndpoint() {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java Thu Oct 25
10:53:26 2012
@@ -109,11 +109,10 @@ public final class ContextUtils {
     * @return true iff the message direction is outbound
     */
     public static boolean isOutbound(Message message) {
-        Exchange exchange = message.getExchange();
         return message != null
-               && exchange != null
-               && (message == exchange.getOutMessage()
-                   || message == exchange.getOutFaultMessage());
+               && message.getExchange() != null
+               && (message == message.getExchange().getOutMessage()
+                   || message == message.getExchange().getOutFaultMessage());
     }
 
    /**

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
Thu Oct 25 10:53:26 2012
@@ -198,9 +198,11 @@ public class ExtensionManagerImpl implem
  
         Object obj = e.load(loader, bus);
         
-        Configurer configurer = (Configurer)(activated.get(Configurer.class));
-        if (null != configurer) {
-            configurer.configureBean(obj);
+        if (null != activated) {
+            Configurer configurer = (Configurer)(activated.get(Configurer.class));
+            if (null != configurer) {
+                configurer.configureBean(obj);
+            }
         }
         
         // let the object know for which namespaces it has been activated

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
Thu Oct 25 10:53:26 2012
@@ -260,9 +260,9 @@ public class MessageModeOutInterceptor e
                 boolean client = isRequestor(message);
                 BindingMessageInfo bmsg = null; 
 
-                if (client) {
+                if (client && bop != null) {
                     bmsg = bop.getInput();
-                } else if (bop.getOutput() != null) {
+                } else if (bop != null && bop.getOutput() != null) {
                     bmsg = bop.getOutput();  
                 }
                 if (bmsg != null && bmsg.getMessageParts() != null 
@@ -293,4 +293,4 @@ public class MessageModeOutInterceptor e
         }
     }
         
-}
\ No newline at end of file
+}

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
Thu Oct 25 10:53:26 2012
@@ -97,16 +97,18 @@ public abstract class AbstractSpnegoAuth
                             final GSSContext context) throws GSSException,
         LoginException {
         
+        final byte[] token = new byte[0];
+        if (authPolicy == null) {
+            return context.initSecContext(token, 0, token.length);
+        }
+
         String contextName = authPolicy.getAuthorization();
         if (contextName == null) {
             contextName = "";
         }
         
-        final byte[] token = new byte[0];
-
-        if (authPolicy == null 
-            || (StringUtils.isEmpty(authPolicy.getUserName())
-                && StringUtils.isEmpty(contextName) && loginConfig == null))
{
+        if (StringUtils.isEmpty(authPolicy.getUserName())
+            && StringUtils.isEmpty(contextName) && loginConfig == null) {
             return context.initSecContext(token, 0, token.length);
         }
         

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/DigestAuthSupplier.java
Thu Oct 25 10:53:26 2012
@@ -64,7 +64,7 @@ public class DigestAuthSupplier implemen
                                    URI currentURI,
                                    Message message,
                                    String fullHeader) {
-        if (authPolicy.getUserName() == null && authPolicy.getPassword() == null)
{
+        if (authPolicy == null || (authPolicy.getUserName() == null && authPolicy.getPassword()
== null)) {
             return null;
         }
         
@@ -82,7 +82,7 @@ public class DigestAuthSupplier implemen
             }
         }
         HttpAuthHeader authHeader = new HttpAuthHeader(fullHeader);
-        if (authHeader.authTypeIsDigest() && authPolicy != null) {
+        if (authHeader.authTypeIsDigest()) {
             Map<String, String> map = authHeader.getParams();
             if ("auth".equals(map.get("qop"))
                 || !map.containsKey("qop")) {

Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java (original)
+++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSUtils.java Thu
Oct 25 10:53:26 2012
@@ -513,6 +513,10 @@ public final class JMSUtils {
     private static void setJMSMessageProperties(Message jmsMessage, JMSMessageHeadersType
messageProperties)
         throws JMSException {
 
+        if (messageProperties == null) {
+            return;
+        }
+
         if (messageProperties.isSetSOAPJMSTargetService()) {
             jmsMessage.setStringProperty(JMSSpecConstants.TARGETSERVICE_FIELD, messageProperties
                 .getSOAPJMSTargetService());
@@ -546,7 +550,7 @@ public final class JMSUtils {
                 .getSOAPJMSRequestURI());
         }
 
-        if (messageProperties != null && messageProperties.isSetProperty()) {
+        if (messageProperties.isSetProperty()) {
             List<JMSPropertyType> props = messageProperties.getProperty();
             for (int x = 0; x < props.size(); x++) {
                 jmsMessage.setStringProperty(props.get(x).getName(), props.get(x).getValue());

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
Thu Oct 25 10:53:26 2012
@@ -146,11 +146,12 @@ public class EndpointPolicyImpl implemen
     }
    
     void initializePolicy() {
-        policy = engine.getAggregatedServicePolicy(ei.getService());
-        policy = policy.merge(engine.getAggregatedEndpointPolicy(ei));
-        if (!policy.isEmpty()) {
-            policy = policy.normalize(engine == null ? null : engine.getRegistry(),
-                                              true);
+        if (engine != null) {
+            policy = engine.getAggregatedServicePolicy(ei.getService());
+            policy = policy.merge(engine.getAggregatedEndpointPolicy(ei));
+            if (!policy.isEmpty()) {
+                policy = policy.normalize(engine.getRegistry(), true);
+            }
         }
     }
 

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java?rev=1402099&r1=1402098&r2=1402099&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyOutInterceptor.java
Thu Oct 25 10:53:26 2012
@@ -98,8 +98,10 @@ public class PolicyOutInterceptor extend
             // add the required interceptors
             EffectivePolicy effectivePolicy = pe.getEffectiveClientRequestPolicy(ei, boi,
conduit);
             msg.put(EffectivePolicy.class, effectivePolicy);
-            PolicyUtils.logPolicy(LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy());
             if (effectivePolicy != null) {
+                PolicyUtils.logPolicy(
+                    LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy()
+                );
                 interceptors.addAll(effectivePolicy.getInterceptors());
                 assertions.addAll(effectivePolicy.getChosenAlternative());
             }
@@ -111,8 +113,10 @@ public class PolicyOutInterceptor extend
             EffectivePolicy effectivePolicy 
                 = pe.getEffectiveServerResponsePolicy(ei, boi, destination, incoming);
             msg.put(EffectivePolicy.class, effectivePolicy);
-            PolicyUtils.logPolicy(LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy());
             if (effectivePolicy != null) {
+                PolicyUtils.logPolicy(
+                    LOG, Level.FINEST, "Using effective policy: ", effectivePolicy.getPolicy()
+                );
                 interceptors.addAll(effectivePolicy.getInterceptors());
                 assertions.addAll(effectivePolicy.getChosenAlternative());
             }

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=1402099&r1=1402098&r2=1402099&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
Thu Oct 25 10:53:26 2012
@@ -392,13 +392,12 @@ public class ScopedNameVisitor extends V
                                                     VisitorTypeHolder holder) {
         List<Scope> inheritedList = new ArrayList<Scope>();
         boolean result = false;
-        for (Scope scopeName : scopeList) {
-            inheritedList.add(scopeName);
-        }        
         
         if (scopeList != null) {            
+            for (Scope scopeName : scopeList) {
+                inheritedList.add(scopeName);
+            }        
             for (Scope inheritScope : scopeList) {
-
                 Scope scopedName = new Scope(inheritScope, node);
                 result = findScopeSchemaType(scopedName, schemaRef, wsdlVisitor, holder);
                 if (!result) {

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=1402099&r1=1402098&r2=1402099&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 Oct 25 10:53:26 2012
@@ -362,13 +362,14 @@ public class WSDLToCorbaHelper {
                                         element.getMaxOccurs(), element.getMinOccurs(), false);
             }
 
-            membertype.setName(arraytype.getName());
-            membertype.setQName(arraytype.getQName());
-            membertype.setType(arraytype.getType());
-
-            if (arraytype != null
-                && !isDuplicate(arraytype)) {
-                typeMappingType.getStructOrExceptionOrUnion().add(arraytype);
+            if (arraytype != null) {
+                membertype.setName(arraytype.getName());
+                membertype.setQName(arraytype.getQName());
+                membertype.setType(arraytype.getType());
+
+                if (!isDuplicate(arraytype)) {
+                    typeMappingType.getStructOrExceptionOrUnion().add(arraytype);
+                }
             }
         }
         membertype.setQualified(elementQualified);
@@ -1219,16 +1220,18 @@ public class WSDLToCorbaHelper {
         Union choiceunion = createUnion(choicename, choice,
                                         defaultName, schematypeName);
 
-        String repoId = REPO_STRING + choiceunion.getQName().getLocalPart().replace('.',
'/')
-            + IDL_VERSION;
-        choiceunion.setRepositoryID(repoId);
-
         MemberType choicemem = new MemberType();
-        choicemem.setName(choiceunion.getQName().getLocalPart() + "_f");
-        choicemem.setIdltype(createQNameCorbaNamespace(choiceunion.getQName().getLocalPart()));
+        if (choiceunion != null) {
+            String repoId = REPO_STRING + choiceunion.getQName().getLocalPart().replace('.',
'/')
+                + IDL_VERSION;
+            choiceunion.setRepositoryID(repoId);
+
+            choicemem.setName(choiceunion.getQName().getLocalPart() + "_f");
+            choicemem.setIdltype(createQNameCorbaNamespace(choiceunion.getQName().getLocalPart()));
 
-        if ((choiceunion != null) && (!isDuplicate(choiceunion))) {
-            typeMappingType.getStructOrExceptionOrUnion().add(choiceunion);
+            if (!isDuplicate(choiceunion)) {
+                typeMappingType.getStructOrExceptionOrUnion().add(choiceunion);
+            }
         }
 
         return choicemem;
@@ -1319,24 +1322,23 @@ public class WSDLToCorbaHelper {
             }
         }
 
-
-        if (arrayEl.isNillable()) {
-            QName nilunionname = createQNameTargetNamespace(arrayType.getQName().getLocalPart()
+ "_nil");
-            boolean isQualified = arrayType.isSetQualified() && arrayType.isQualified();
-            arrayType = createNillableUnion(nilunionname,
+        Long maxOccurs = null;
+        Long minOccurs = null;
+        if (arrayEl != null) {
+            if (arrayEl.isNillable()) {
+                QName nilunionname = createQNameTargetNamespace(arrayType.getQName().getLocalPart()
+ "_nil");
+                boolean isQualified = arrayType.isSetQualified() && arrayType.isQualified();
+                arrayType = createNillableUnion(nilunionname,
                                             elName,
                                             arrayType.getQName(),
                                             isQualified);
-            typeName = createQNameCorbaNamespace(arrayType.getQName().getLocalPart());
-            if (arrayType != null
-                && !isDuplicate(arrayType)) {
-                typeMappingType.getStructOrExceptionOrUnion().add(arrayType);
+                typeName = createQNameCorbaNamespace(arrayType.getQName().getLocalPart());
+                if (arrayType != null
+                    && !isDuplicate(arrayType)) {
+                    typeMappingType.getStructOrExceptionOrUnion().add(arrayType);
+                }
             }
-        }
 
-        Long maxOccurs = null;
-        Long minOccurs = null;
-        if (arrayEl != null) {
             maxOccurs = arrayEl.getMaxOccurs();
             minOccurs = arrayEl.getMinOccurs();
         }



Mime
View raw message