Commit 446f9b4c authored by afreyssin's avatar afreyssin
Browse files

Minor changes.

parent c2316645
/* /*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging * JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2013 ScalAgent Distributed Technologies * Copyright (C) 2001 - 2017 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade * Copyright (C) 1996 - 2000 Dyade
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
...@@ -309,8 +309,7 @@ public final class MapMessage extends Message implements javax.jms.MapMessage { ...@@ -309,8 +309,7 @@ public final class MapMessage extends Message implements javax.jms.MapMessage {
*/ */
public void setObject(String name, Object value) throws JMSException { public void setObject(String name, Object value) throws JMSException {
if (RObody) if (RObody)
throw new MessageNotWriteableException("Can't set a value as the message" throw new MessageNotWriteableException("Can't set a value as the message body is read-only.");
+ " body is read-only.");
if (name == null || name.equals("")) if (name == null || name.equals(""))
throw new IllegalArgumentException("Invalid null or empty value name."); throw new IllegalArgumentException("Invalid null or empty value name.");
...@@ -320,8 +319,7 @@ public final class MapMessage extends Message implements javax.jms.MapMessage { ...@@ -320,8 +319,7 @@ public final class MapMessage extends Message implements javax.jms.MapMessage {
value instanceof byte[] || value == null) value instanceof byte[] || value == null)
map.put(name, value); map.put(name, value);
else else
throw new MessageFormatException("Can't set non Java primitive type as" throw new MessageFormatException("Can't set non Java primitive type as a map value.");
+ " a map value.");
} }
/** /**
...@@ -510,7 +508,7 @@ public final class MapMessage extends Message implements javax.jms.MapMessage { ...@@ -510,7 +508,7 @@ public final class MapMessage extends Message implements javax.jms.MapMessage {
if (value instanceof byte[]) if (value instanceof byte[])
throw new MessageFormatException("Type " + value.getClass().getName() throw new MessageFormatException("Type " + value.getClass().getName()
+ " can't be converted to String."); + " can't be converted to String.");
return ConversionHelper.toString(map.get(name)); return ConversionHelper.toString(value);
} }
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment