cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1239385 - in /cxf/branches/2.5.x-fixes/rt: core/src/main/java/org/apache/cxf/interceptor/ frontend/simple/src/main/java/org/apache/cxf/service/factory/
Date Wed, 01 Feb 2012 22:53:37 GMT
Author: ay
Date: Wed Feb  1 22:53:37 2012
New Revision: 1239385

URL: http://svn.apache.org/viewvc?rev=1239385&view=rev
Log:
[CXF-4072] avoid NPE when a fault has no part

Modified:
    cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
    cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties

Modified: cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java?rev=1239385&r1=1239384&r2=1239385&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
Wed Feb  1 22:53:37 2012
@@ -160,7 +160,7 @@ public class FaultOutInterceptor extends
 
             FaultInfo faultInfo = bfi.getFaultInfo();
             Class<?> c = (Class)faultInfo.getProperty(Class.class.getName());
-            if (c.isAssignableFrom(class1)) {
+            if (c != null && c.isAssignableFrom(class1)) {
                 return faultInfo;
             }
         }

Modified: cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=1239385&r1=1239384&r2=1239385&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Wed Feb  1 22:53:37 2012
@@ -859,7 +859,12 @@ public class ReflectionServiceFactoryBea
             QName name = getFaultName(o.getInterface(), o, exClass, beanClass);
 
             for (FaultInfo fi : o.getFaults()) {
-                for (MessagePartInfo mpi : fi.getMessageParts()) {
+                List<MessagePartInfo> mpis = fi.getMessageParts();
+                if (mpis.size() != 1) {
+                    Message message = new Message("NO_FAULT_PART", LOG, fi.getFaultName());

+                    LOG.log(Level.WARNING, message.toString());
+                }
+                for (MessagePartInfo mpi : mpis) {
                     String ns = null;
                     if (mpi.isElement()) {
                         ns = mpi.getElementQName().getNamespaceURI();

Modified: cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties?rev=1239385&r1=1239384&r2=1239385&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
Wed Feb  1 22:53:37 2012
@@ -34,3 +34,4 @@ JAXWS_ANNOTATION_FOUND=A JAX-WS Annotati
 XSD_VALIDATION_ERROR= Error in W3C XML Schema associated with service: {0}
 COULD_NOT_UNWRAP=Could not unwrap Operation {0} to match method "{1}"
 NO_WSDL_PROVIDED=WSDL is required for services created from class {0}, but no WSDL location
specified. 
+NO_FAULT_PART = Could not find a fault part for {0}. The fault message must have a single
part.



Mime
View raw message