You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by ri...@apache.org on 2006/12/15 14:02:44 UTC
svn commit: r487544 -
/incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/util/Util.java
Author: rickmcguire
Date: Fri Dec 15 05:02:43 2006
New Revision: 487544
URL: http://svn.apache.org/viewvc?view=rev&rev=487544
Log:
OPENEJB-408 Util.writeObject() fails when object is array of remote interfaces.
Modified:
incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/util/Util.java
Modified: incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/util/Util.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/util/Util.java?view=diff&rev=487544&r1=487543&r2=487544
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/util/Util.java (original)
+++ incubator/openejb/trunk/openejb2/modules/openejb-corba/src/main/java/org/apache/openejb/corba/util/Util.java Fri Dec 15 05:02:43 2006
@@ -427,7 +427,12 @@
// copy the result to force replacement
// corba does not call writeReplace on remote proxies
- if (object instanceof Serializable) {
+ //
+ // HOWEVER, if this is an array, then we don't want to do the replacement
+ // because we can end up with a replacement element that's not compatible with the
+ // original array type, which results in an ArrayStoreException. Fortunately,
+ // the Yoko RMI support appears to be able to sort this out for us correctly.
+ if (object instanceof Serializable && !object.getClass().isArray()) {
try {
object = SerializationHandler.copyObj(Thread.currentThread().getContextClassLoader(), object);
} catch (Exception e) {