fixed bad use of null for AMQ-1904

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@688014 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2008-08-22 08:11:00 +00:00
parent 9cd9a00dc3
commit a634647560
1 changed files with 9 additions and 1 deletions

View File

@ -26,6 +26,7 @@ import java.util.Set;
import javax.jms.DeliveryMode;
import javax.jms.JMSException;
import javax.jms.Destination;
import javax.management.openmbean.ArrayType;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.CompositeDataSupport;
@ -154,7 +155,7 @@ public final class OpenTypeSupport {
rc.put("JMSCorrelationID", m.getJMSCorrelationID());
rc.put("JMSDestination", "" + m.getJMSDestination());
rc.put("JMSMessageID", m.getJMSMessageID());
rc.put("JMSReplyTo", "" + m.getJMSReplyTo());
rc.put("JMSReplyTo",toString(m.getJMSReplyTo()));
rc.put("JMSType", m.getJMSType());
rc.put("JMSDeliveryMode", m.getJMSDeliveryMode() == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON-PERSISTENT");
rc.put("JMSExpiration", Long.valueOf(m.getJMSExpiration()));
@ -212,6 +213,13 @@ public final class OpenTypeSupport {
return rc;
}
protected String toString(Object value) {
if (value == null) {
return null;
}
return value.toString();
}
protected <T> TabularType createTabularType(Class<T> type, OpenType openType) throws OpenDataException {
String typeName = "java.util.Map<java.lang.String, " + type.getName() + ">";