users@jms-spec.java.net

[jms-spec users] [jsr343-experts] Re: (JMS_SPEC-77) MapMessage.setBytes API discrepancy found in the javadocs

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Mon, 03 Sep 2012 18:41:21 +0100

On 22/02/2012 15:18, Nigel Deakin wrote:
> I refer to this JIRA issue logged by someone in the TCK team:
> http://java.net/jira/browse/JMS_SPEC-77
> MapMessage.setBytes API discrepancy found in the javadocs
>
> I won't repeat the description here: please follow the link above for a description of the issue and my response. I
> hereby propose this is fixed for the Public Draft.

I have now made the necessary change to the API documentation for this method, and added a new section to the change
history chapter of the draft spec as follows:

B.5.20 Correction: MapMessage when name is null (JMS_SPEC-77)

In the JMS 1.1 API documentation for javax.jms.MapMessage, the method setBytes (String name, byte[] value) is defined as
throwing a NullPointerException "if the name is null, or if the name is an empty string."

However there are eleven other methods on MapMessage of the form setSomething(name,value). These all specify that a
IllegalArgumentException is thrown "if the name is null or if the name is an empty string."

This appears to be an error in the API documentation. This is confirmed by the JMS compliance tests which already expect
setBytes to throw a IllegalArgumentException.

The API documentation for setBytes has therefore been changed to match the other methods and specify that an
IllegalArgumentException should be thrown in this case.

Updated spec at
http://java.net/projects/jms-spec/sources/repository/content/jms2.0/specification/word/JMS20.pdf

Updated javadoc at
http://jms-spec.java.net/2.0-SNAPSHOT/apidocs/index.html

Nigel