From 56ecac6977e8df33ae467d36e2d1a87b693b2b87 Mon Sep 17 00:00:00 2001 From: scottkurz Date: Fri, 25 Jul 2008 02:03:21 +0000 Subject: Fix clobbering of RuntimeExc with null causing later NPE git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@679644 13f79535-47bb-0310-9956-ffa450edef68 --- .../core/databinding/wire/DataTransformationInterceptor.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sandbox/scottkurz') diff --git a/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java b/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java index 89ce15e796..83ee0a12f3 100644 --- a/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java +++ b/sandbox/scottkurz/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/DataTransformationInterceptor.java @@ -96,12 +96,14 @@ public class DataTransformationInterceptor implements Interceptor, DataExchangeS 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); -- cgit v1.2.3