You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/02/25 18:02:23 UTC
svn commit: r630935 -
/incubator/tuscany/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java
Author: rfeng
Date: Mon Feb 25 09:02:15 2008
New Revision: 630935
URL: http://svn.apache.org/viewvc?rev=630935&view=rev
Log:
Ignore CloneNotSupportedException for data copy
Modified:
incubator/tuscany/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java
Modified: incubator/tuscany/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java?rev=630935&r1=630934&r2=630935&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java (original)
+++ incubator/tuscany/java/sca/modules/core-databinding/src/main/java/org/apache/tuscany/sca/core/databinding/wire/PassByValueInterceptor.java Mon Feb 25 09:02:15 2008
@@ -21,6 +21,7 @@
import java.io.Serializable;
import java.lang.reflect.Array;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.IdentityHashMap;
import java.util.List;
@@ -208,16 +209,22 @@
if (!(data instanceof Serializable)) {
dataBinding = jaxbDataBinding;
}
-
- if(data instanceof Cloneable) {
+
+ if (data instanceof Cloneable) {
Method clone;
try {
- clone = data.getClass().getMethod("clone", (Class[]) null);
+ clone = data.getClass().getMethod("clone", (Class[])null);
try {
- return clone.invoke(data, (Object[]) null);
+ return clone.invoke(data, (Object[])null);
+ } catch (InvocationTargetException e) {
+ if (e.getTargetException() instanceof CloneNotSupportedException) {
+ // Ignore
+ } else {
+ throw new ServiceRuntimeException(e);
+ }
} catch (Exception e) {
throw new ServiceRuntimeException(e);
- }
+ }
} catch (NoSuchMethodException e) {
// Ignore it
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org