Author: ningjiang
Date: Tue Sep 2 20:35:36 2008
New Revision: 691500
URL: http://svn.apache.org/viewvc?rev=691500&view=rev
Log:
CAMEL-874 Polished the codes with the Calus's comment
Modified:
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHelper.java
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHolder.java
Modified:
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHelper.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHelper.java?rev=691500&r1=691499&r2=691500&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHelper.java
(original)
+++
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHelper.java
Tue Sep 2 20:35:36 2008
@@ -35,7 +35,7 @@
public static Object getIn(MinaEndpoint endpoint, Exchange exchange) {
if (endpoint.isTransferExchange()) {
- // we should transfer the entire exchange over the wire (includes
in/out)\
+ // we should transfer the entire exchange over the wire (includes
in/out)
return MinaPayloadHolder.marshal(exchange);
} else {
// normal transfer using the body only
Modified:
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHolder.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHolder.java?rev=691500&r1=691499&r2=691500&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHolder.java
(original)
+++
activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaPayloadHolder.java
Tue Sep 2 20:35:36 2008
@@ -114,7 +114,7 @@
if (object instanceof Serializable) {
return object;
} else {
- LOG.warn("Object " + object + " can't be serialized, it will be
exculed by the MinaPayloadHold");
+ LOG.warn("Object " + object + " can't be serialized, it will be
exclued by the MinaPayloadHolder");
return null;
}
}
@@ -123,15 +123,15 @@
if (map == null) {
return null;
}
- Set<String> keys = map.keySet();
+
Map<String, Object> result = new LinkedHashMap<String, Object>();
- for (String key : keys) {
- Object object = map.get(key);
- if (object instanceof Serializable) {
- result.put(key, object);
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
+
+ if (entry.getValue() instanceof Serializable) {
+ result.put(entry.getKey(), entry.getValue());
} else {
- LOG.warn("Object " + object + " of key " + key
- + " can't be serialized, it will be exculed by the
MinaPayloadHold");
+ LOG.warn("Object " + entry.getValue() + " of key " +
entry.getKey()
+ + " can't be serialized, it will be exclued by the
MinaPayloadHolder");
}
}
return result;