[JMS_SPEC-78] JMS implementation of QueueRequestor and TopicRequestor doesn't throw correct exception when destination is null Created: 16/Feb/12 Updated: 20/Mar/13 Resolved: 04/Sep/12
|Fix Version/s:||2.0PD, 2.0|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
The javadocs for the constructor methods QueueRequestor(session,queue) and TopicRequestor(session,topic) state that a InvalidDestinationException should be thrown if an invalid queue/topic is specified.
However if a value of null is supplied no exception is thrown, despite this not being valid.
These classes are supplied with JMS rather than by implementations, which is why this is being logged here rather than with any particular JMS provider.
If you look at the implementation:
you can see why it doesn't throw an exception. Calling createQueue(null) is valid as it creates an anonymous producer. However although this is valid in general it isn't valid here. An explicit check for null needs to be added which should cause a InvalidDestinationException to be thrown.
|Comment by Nigel Deakin [ 04/Sep/12 ]|
Note that the implementation of these classes is actually part of the RI.