Revert "fix up createPublisher contract to throw on null topic param, match the java doc"

the java doc allows null for an anonymous publish - the check needs to go in TopicRequestor part of the jdk

This reverts commit 29ecfd6cdb.
This commit is contained in:
gtully 2016-12-02 13:57:44 +00:00
parent 59bfffd2b4
commit 6a0c65828a
2 changed files with 0 additions and 20 deletions

View File

@ -1701,9 +1701,6 @@ public class ActiveMQSession implements Session, QueueSession, TopicSession, Sta
*/
@Override
public TopicPublisher createPublisher(Topic topic) throws JMSException {
if (topic == null) {
throw new InvalidDestinationException("topic is null");
}
checkClosed();
if (topic instanceof CustomDestination) {

View File

@ -17,17 +17,14 @@
package org.apache.activemq;
import javax.jms.Connection;
import javax.jms.TopicConnection;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TopicSession;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.jms.TopicRequestor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -153,20 +150,6 @@ public class JmsTopicRedeliverTest extends TestSupport {
assertNull(consumer.receiveNoWait());
}
public void testExOnNullDestToTopicRequestor() throws Exception {
TopicConnection topicConnection = connectionFactory.createTopicConnection();
TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
try {
TopicRequestor topicRequestor = new TopicRequestor(topicSession, null);
fail("Expect ex on invalid dest");
} catch (javax.jms.InvalidDestinationException expected) {
} finally {
topicConnection.close();
}
}
protected MessageConsumer createConsumer() throws JMSException {
if (durable) {
LOG.info("Creating durable consumer");