You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sc...@apache.org on 2008/07/25 04:03:21 UTC

svn commit: r679644 - /tuscany/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java

Author: scottkurz
Date: Thu Jul 24 19:03:21 2008
New Revision: 679644

URL: http://svn.apache.org/viewvc?rev=679644&view=rev
Log:
Fix clobbering of RuntimeExc with null causing later NPE

Modified:
    tuscany/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java

Modified: tuscany/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java?rev=679644&r1=679643&r2=679644&view=diff
==============================================================================
--- tuscany/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java (original)
+++ tuscany/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java Thu Jul 24 19:03:21 2008
@@ -96,12 +96,14 @@
             Object transformedFault = null;
             if ((result instanceof Exception) && !(result instanceof RuntimeException)) {
                 transformedFault = faultTransformHelper.transformFault(result, sourceOperation, targetOperation, wire);
+                if (transformedFault != result) {
+                    resultMsg.setFaultBody(transformedFault);
+                }
             } 
-            // Otherwise, we leave it to another layer to actually throw the RuntimeException which constitutes
+            //
+            // Leave it to another layer to actually throw the Exception which constitutes
             // the message body.  We don't throw it here.
-            if (transformedFault != result) {
-                resultMsg.setFaultBody(transformedFault);
-            }
+            // 
         } else {
             assert !(result instanceof Throwable) : "Expected messages that are not throwable " + result;
             Object newResult = transform(result, targetType, sourceType, true);