messaging icon indicating copy to clipboard operation
messaging copied to clipboard

Ambiguous javadocs for Connection.createConnectionConsumer and createDurableConnectionConsumer

Open glassfishrobot opened this issue 13 years ago • 4 comments

The JMS 1.1 javadocs for Connection.createConnectionConsumer lists the following possible exceptions:

JMSException - if the Connection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector. InvalidDestinationException - if an invalid destination is specified. InvalidSelectorException - if the message selector is invalid.

The JMS 1.1 javadocs for Connection.createDurableConnectionConsumer lists the following possible exceptions:

JMSException - if the Connection object fails to create a connection consumer due to some internal error or invalid arguments for sessionPool and messageSelector. InvalidDestinationException - if an invalid destination is specified. InvalidSelectorException - if the message selector is invalid.

So what exception is thrown if a invalid message selector is supplied? An InvalidSelectorException (since the message selector is invalid) or a JMSException (invalid argument for messageSelector).

Since a InvalidSelectorException is a subtype of JMSException then it would be safe to return a InvalidSelectorException, but the javadocs as they stand are contradictory.

Affected Versions

[1.1]

glassfishrobot avatar Feb 15 '12 15:02 glassfishrobot

  • Issue Imported From: https://github.com/javaee/jms-spec/issues/75
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: Unassigned

glassfishrobot avatar Feb 12 '18 18:02 glassfishrobot

@glassfishrobot Commented Reported by @nigeldeakin

glassfishrobot avatar Feb 15 '12 15:02 glassfishrobot

@glassfishrobot Commented @nigeldeakin said: This didn't make it into JMS 2.0 and so is carried forward to JMS 2.1.

glassfishrobot avatar Mar 20 '13 12:03 glassfishrobot

@glassfishrobot Commented This issue was imported from java.net JIRA JMS_SPEC-75

glassfishrobot avatar May 02 '17 10:05 glassfishrobot