[JMS_SPEC-3] Fix JavaDocs to reflect missing NumberFormatException from API methods Created: 11/Apr/11  Updated: 20/Mar/13

Status: Open
Project: jms-spec
Component/s: None
Affects Version/s: 1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: alanf760 Assignee: Nigel Deakin
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

N/A


Tags: jms21doc-minor

 Description   

---------------------------
NumberFormatException tests
---------------------------

For javax.jms.MapMessage and javax.jms.StreamMessage the JavaDoc's need to be updated for the string to numeric conversions. The String to numeric conversions must throw a
java.lang.NumberFormatException if the numerics valueOf() method does not accept the the String value as a valid representation.

Tests for (NumberFormatException) which is not listed in JavaDoc for the getXXX() methods. Test in question is: MapMessageConversionQTestsInvFormatString. The
(NumberFormatException) is mentioned in spec but missing in JavaDoc.

The JavaDoc's for the following methods below of class javax.jms.MapMessage and class javax.jms.StreamMessage need to be modified to add the NumberFormatException.

getBoolean, getByte, getShort, getInt, getLong, getFloat, getDouble, etc



 Comments   
Comment by Nigel Deakin [ 11/Apr/11 ]

A big thank you to Alan for logging our first issue!

Comment by Nigel Deakin [ 28/Feb/12 ]

The JMS 1.1 spec, section 3.11.3 "Conversions provided by StreamMessage and MapMessage" states:

Both StreamMessage and MapMessage support the following conversion table. The marked cases must be supported. The unmarked cases must throw a JMS MessageFormatException. The String to numeric conversions must throw a java.lang.NumberFormatException if the numeric’s valueOf() method does not accept the String value as a valid representation.

This means that the methods this return a numeric: getShort, getLong, getDouble, getInt must throw a java.lang.NumberFormatException in the case described. This seems clear.

However I'm not sure about the methods which don't return a numeric, such as getBoolean. getByte and getBytes. Where does it say that these must throw a java.lang.NumberFormatException?

Tagging for review for the Public Draft.

Comment by Nigel Deakin [ 20/Mar/13 ]

This didn't make it into JMS 2.0 and so is carried forward to JMS 2.1.

Generated at Mon Jul 14 12:25:04 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.