cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1465373 - /cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.java
Date Sun, 07 Apr 2013 12:33:00 GMT
Author: ffang
Date: Sun Apr  7 12:32:59 2013
New Revision: 1465373

URL: http://svn.apache.org/r1465373
Log:
[CXF-4940]CXF not (always) responding with the correct exception when working with an exception
hierarchy 

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/FaultOutInterceptor.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=1465373&r1=1465372&r2=1465373&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 Sun Apr
 7 12:32:59 2013
@@ -151,15 +151,19 @@ public class FaultOutInterceptor extends
      * @param class1
      */
     public FaultInfo getFaultForClass(BindingOperationInfo op, Class<?> class1) {
+        FaultInfo selectedFaultInfo = null;
+        Class<?> selectedFaultInfoClass = null;
         for (BindingFaultInfo bfi : op.getFaults()) {
 
             FaultInfo faultInfo = bfi.getFaultInfo();
             Class<?> c = (Class<?>)faultInfo.getProperty(Class.class.getName());
-            if (c != null && c.isAssignableFrom(class1)) {
-                return faultInfo;
+            if (c != null && c.isAssignableFrom(class1)
+                && (selectedFaultInfo == null || selectedFaultInfoClass.isAssignableFrom(c)))
{
+                selectedFaultInfo = faultInfo;
+                selectedFaultInfoClass = c;
+
             }
         }
-
-        return null;
+        return selectedFaultInfo;
     }
 }



Mime
View raw message