Commit 49338932 authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Reports changes to fit with JoramMQ 1.14 needs.

parent 40f693a8
......@@ -243,7 +243,7 @@ public class Properties implements Serializable, Cloneable, Encodable {
* @return the previous value of the specified key in this property object, or null if it did not have one.
*/
public Object setProperty(String key, Object value) throws ClassCastException {
if ((value instanceof Number) || (value instanceof String)) {
if ((value instanceof Boolean) || (value instanceof Number) || (value instanceof String)) {
return put(key, value);
}
throw new ClassCastException("Bad property value: " + value.getClass());
......
......@@ -107,7 +107,8 @@ public final class Message implements Cloneable, Serializable, Streamable, Encod
/**
* Sets a property value.
* If the value is not a Java primitive object its string representation is used.
* If the value is not a Java primitive object (Boolean, Number, String or byte[]) its string representation is used.
*
* @param name The property name.
* @param value The property value.
......@@ -121,7 +122,7 @@ public final class Message implements Cloneable, Serializable, Streamable, Encod
if (properties == null)
properties = new Properties();
if (value instanceof Boolean || value instanceof Number || value instanceof String) {
if (value instanceof Boolean || value instanceof Number || value instanceof String || value instanceof byte[]) {
properties.put(name, value);
} else {
properties.put(name, value.toString());
......
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