cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject svn commit: r1239373 - in /cxf/trunk: api/src/main/java/org/apache/cxf/interceptor/ rt/core/src/main/java/org/apache/cxf/service/factory/
Date Wed, 01 Feb 2012 22:29:20 GMT
Author: ay
Date: Wed Feb  1 22:29:19 2012
New Revision: 1239373

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

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/Messages.properties
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java?rev=1239373&r1=1239372&r2=1239373&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java Wed Feb
 1 22:29:19 2012
@@ -168,7 +168,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/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/Messages.properties?rev=1239373&r1=1239372&r2=1239373&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/Messages.properties (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/Messages.properties Wed
Feb  1 22:29:19 2012
@@ -37,3 +37,5 @@ 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.
+

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=1239373&r1=1239372&r2=1239373&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Wed Feb  1 22:29:19 2012
@@ -887,7 +887,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();



Mime
View raw message