]
Tim Fox reopened JBMESSAGING-622:
---------------------------------
JBossMessage.setJMSReplyTo() method does not allow to set up nulls
------------------------------------------------------------------
Key: JBMESSAGING-622
URL:
http://jira.jboss.com/jira/browse/JBMESSAGING-622
Project: JBoss Messaging
Issue Type: Bug
Components: Messaging Core
Affects Versions: 1.0.1.GA
Reporter: Ilya Bochkov
Assigned To: Tyronne Wickramarathne
Fix For: 1.2.0.SP2
Attachments: patch-1.0.zip, patch.zip
The method body checks if a destination is an instance of JBossDestination. If you pass
null then an exception is thrown, though null is a valid value.
public void setJMSReplyTo(Destination replyTo) throws JMSException
{
if (!(replyTo instanceof JBossDestination))
{
throw new InvalidDestinationException("Replyto cannot be foreign");
}
this.replyToDestination = (JBossDestination)replyTo;
}
I've changed the method definition to:
public void setJMSReplyTo(Destination replyTo) throws JMSException
{
if(replyTo == null){
this.replyToDestination = null;
return;
}
if (!(replyTo instanceof JBossDestination))
{
throw new InvalidDestinationException("Replyto cannot be foreign");
}
this.replyToDestination = (JBossDestination)replyTo;
}
Please, if this is a correct fix incorporate it in future releases.
Thanks!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: