Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
ActiveMqMapMessage, line ~437:
public double getDouble(String name) throws JMSException { initializeReading(); Object value = map.get(name); if (value == null) { return 0; } if (value instanceof Double) { return ((Double)value).doubleValue(); } if (value instanceof Float) { return ((Float)value).floatValue(); } if (value instanceof UTF8Buffer) { return Float.valueOf(value.toString()).floatValue(); } if (value instanceof String) { return Float.valueOf(value.toString()).floatValue(); } else { throw new MessageFormatException(" cannot read a double from " + value.getClass().getName()); } }
Notice the ifs on String or UTF8Buffer and the use of Float.valueOf.
I noticed this when Strings representing anything higher than Float.MAX_VALUE ended up as Infinity, and anything below Float.MIN_VALUE ended up as 0.