servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1513057 - /servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
Date Mon, 12 Aug 2013 07:10:59 GMT
Author: ffang
Date: Mon Aug 12 07:10:59 2013
New Revision: 1513057

URL: http://svn.apache.org/r1513057
Log:
[SMX4-1513]add type check to avoid CCE in cxf nmr transport

Modified:
    servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java

Modified: servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java?rev=1513057&r1=1513056&r2=1513057&view=diff
==============================================================================
--- servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
(original)
+++ servicemix/smx4/features/trunk/cxf/cxf-transport-nmr/src/main/java/org/apache/servicemix/cxf/transport/nmr/NMRDestinationOutputStream.java
Mon Aug 12 07:10:59 2013
@@ -83,9 +83,14 @@ public class NMRDestinationOutputStream 
                 Exchange xchng = inMessage.get(Exchange.class);
                 LOG.fine(new org.apache.cxf.common.i18n.Message("CREATE.NORMALIZED.MESSAGE",
LOG).toString());
                 if (inMessage.getExchange().getOutFaultMessage() != null) {
-                    org.apache.cxf.interceptor.Fault f = (org.apache.cxf.interceptor.Fault)
inMessage.getContent(Exception.class);
-                    if (!f.hasDetails()) {
-                        xchng.setError(f);
+                    Exception ex = inMessage.getContent(Exception.class);
+                    if (ex instanceof org.apache.cxf.interceptor.Fault) {
+                        org.apache.cxf.interceptor.Fault f = (org.apache.cxf.interceptor.Fault)
inMessage.getContent(Exception.class);
+                        if (!f.hasDetails()) {
+                            xchng.setError(f);
+                        }
+                    } else {
+                        xchng.setError(ex);
                     }
                     // As the fault is already marshalled by the fault handler
                     xchng.getFault().setBody(ss);



Mime
View raw message