servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r693039 - /servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
Date Mon, 08 Sep 2008 09:48:52 GMT
Author: ffang
Date: Mon Sep  8 02:48:52 2008
New Revision: 693039

URL: http://svn.apache.org/viewvc?rev=693039&view=rev
Log:
[SM-1540]exclude Map or Collection property as well which entry may not be serializable

Modified:
    servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java

Modified: servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
URL: http://svn.apache.org/viewvc/servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java?rev=693039&r1=693038&r2=693039&view=diff
==============================================================================
--- servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
(original)
+++ servicemix/components/engines/servicemix-camel/trunk/src/main/java/org/apache/servicemix/camel/JbiBinding.java
Mon Sep  8 02:48:52 2008
@@ -19,6 +19,7 @@
 import java.io.Serializable;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.Collection;
 import java.util.Map;
 import java.util.Set;
 
@@ -158,7 +159,11 @@
         Set<Map.Entry<String, Object>> entries = camelExchange.getIn().getHeaders().entrySet();
         for (Map.Entry<String, Object> entry : entries) {
             normalizedMessage.setProperty(entry.getKey(), entry.getValue());
-            if (entry.getValue() instanceof Serializable) {
+            //check if value is Serializable, and if value is Map or collection,
+            //just exclude it since the entry of it may not be Serializable as well
+            if (entry.getValue() instanceof Serializable
+                    && !(entry.getValue() instanceof Map)
+                    && !(entry.getValue() instanceof Collection)) {
                 normalizedMessage.setProperty(entry.getKey(), entry.getValue());
             }
         }



Mime
View raw message