- Fix for https://issues.apache.org/activemq/browse/AMQ-1576 (behavior is that if a jms property is null, it will not be converted, but will still be added to the default list of properties)

- Fix a spelling typo


git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@629060 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2008-02-19 10:46:13 +00:00
parent 8768a04e63
commit 13af1e36fb
2 changed files with 49 additions and 48 deletions

View File

@ -181,27 +181,27 @@ public final class ActiveMQMessageTransformation {
* message to the specified message
*
* @param fromMessage the message to take the properties from
* @param toMesage the message to add the properties to
* @param toMessage the message to add the properties to
* @throws JMSException
*/
public static void copyProperties(Message fromMessage, Message toMesage) throws JMSException {
toMesage.setJMSMessageID(fromMessage.getJMSMessageID());
toMesage.setJMSCorrelationID(fromMessage.getJMSCorrelationID());
toMesage.setJMSReplyTo(transformDestination(fromMessage.getJMSReplyTo()));
toMesage.setJMSDestination(transformDestination(fromMessage.getJMSDestination()));
toMesage.setJMSDeliveryMode(fromMessage.getJMSDeliveryMode());
toMesage.setJMSRedelivered(fromMessage.getJMSRedelivered());
toMesage.setJMSType(fromMessage.getJMSType());
toMesage.setJMSExpiration(fromMessage.getJMSExpiration());
toMesage.setJMSPriority(fromMessage.getJMSPriority());
toMesage.setJMSTimestamp(fromMessage.getJMSTimestamp());
public static void copyProperties(Message fromMessage, Message toMessage) throws JMSException {
toMessage.setJMSMessageID(fromMessage.getJMSMessageID());
toMessage.setJMSCorrelationID(fromMessage.getJMSCorrelationID());
toMessage.setJMSReplyTo(transformDestination(fromMessage.getJMSReplyTo()));
toMessage.setJMSDestination(transformDestination(fromMessage.getJMSDestination()));
toMessage.setJMSDeliveryMode(fromMessage.getJMSDeliveryMode());
toMessage.setJMSRedelivered(fromMessage.getJMSRedelivered());
toMessage.setJMSType(fromMessage.getJMSType());
toMessage.setJMSExpiration(fromMessage.getJMSExpiration());
toMessage.setJMSPriority(fromMessage.getJMSPriority());
toMessage.setJMSTimestamp(fromMessage.getJMSTimestamp());
Enumeration propertyNames = fromMessage.getPropertyNames();
while (propertyNames.hasMoreElements()) {
String name = propertyNames.nextElement().toString();
Object obj = fromMessage.getObjectProperty(name);
toMesage.setObjectProperty(name, obj);
toMessage.setObjectProperty(name, obj);
}
}
}

View File

@ -39,8 +39,8 @@ import org.apache.activemq.util.JMSExceptionSupport;
import org.apache.activemq.util.TypeConversionSupport;
/**
* @openwire:marshaller code="23"
* @version $Revision:$
* @openwire:marshaller code="23"
*/
public class ActiveMQMessage extends Message implements org.apache.activemq.Message {
@ -284,6 +284,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess
}
interface PropertySetter {
void set(Message message, Object value) throws MessageFormatException;
}
@ -396,7 +397,7 @@ public class ActiveMQMessage extends Message implements org.apache.activemq.Mess
checkValidObject(value);
PropertySetter setter = JMS_PROPERTY_SETERS.get(name);
if (setter != null) {
if (setter != null && value != null) {
setter.set(this, value);
} else {
try {