jsr343-experts@jms-spec.java.net

[jsr343-experts] (JMS_SPEC-108) add generics to methods currently returning raw types

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Mon, 07 Jan 2013 17:58:26 +0000

"braghest" logged the following JIRA issue a couple of days ago:

-------- Original Message --------
(JMS_SPEC-108) add generics to methods currently returning raw types
http://java.net/jira/browse/JMS_SPEC-108

There are several methods that return raw {{java.util.Enumeration}}. Adding a type parameter would return the potential
for misuse, produce cleaner and safer code and give a better development experience since you don't need to look up the
the JavaDoc, the IDE automatically inserts the right type.

The affected methods are:
* {{javax.jms.QueueBrowser.getEnumeration()}} should return {{Enumeration<Message>}}
* {{javax.jms.Message#getPropertyNames()}} should return {{Enumeration<String>}}
* {{javax.jms.JMSProducer#getPropertyNames()}} should return {{Enumeration<String>}}
* {{javax.jms.MapMessage#getMapNames()}} should return {{Enumeration<String>}}
* {{javax.jms.ConnectionMetaData#getJMSXPropertyNames()}} should return {{Enumeration<String>}}

------------------------------------------------------------------------------------------------

(Nigel adds) I think this is a good proposal (thanks). I don't think it would break backwards compatibility (i.e.
existing application code wouldn't need to be changed).

Any comments?

I'm happy to have a discussion about this now. However now JMS 2.0 has reached the public draft stage we need to avoid
adding new features if at all possible and as this feature is unrelated to any of the changes in JMS 2.0, and can be
added to the next version without introducing any compatibility problems, I propose we defer adding it to the API until
JMS 2.1.

I'm starting a list of JMS 2.1 issues here
http://java.net/projects/jms-spec/pages/JSR343Planning#Minor_issues_to_be_considered_for_JMS_2.1

Nigel