[jboss-jira] [JBoss JIRA] Created: (JBMESSAGING-622) JBossMessage.setJMSReplyTo() method does not allow to set up nulls

Ilya Bochkov (JIRA) jira-events at jboss.com
Fri Oct 20 08:46:42 EDT 2006


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: Ovidiu Feodorov


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: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list