mq
  1. mq
  2. MQ-334

send method in MessageProducer class throws incorrect Exception

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Glassfish 4.0.1 b02 02/07/2013
      Windows

      Description

      When null is specified for send(Message message) in MessageProducer class, NullPointerException is thrown. I think it should throw MessageFormatException instead.

      The manual says:
      MessageFormatException - if an invalid message is specified.

      Similarly, I found similar issues in send method in QueueSender and publish method in TopicPublisher.

        Activity

        Hide
        Nigel Deakin added a comment - - edited

        Strictly speaking, calling send(null) is not passing in an invalid message, but is passing in an invalid value for the message parameter. But I think that's close enough to merit throwing a MessageFormatException as proposed.

        The various send methods on JMSProducer should behave in the same way.

        Show
        Nigel Deakin added a comment - - edited Strictly speaking, calling send(null) is not passing in an invalid message, but is passing in an invalid value for the message parameter. But I think that's close enough to merit throwing a MessageFormatException as proposed. The various send methods on JMSProducer should behave in the same way.

          People

          • Assignee:
            Ed Bratt
            Reporter:
            tak09
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: