From 6a0c65828a771cbc57df18707e497590d7a504bd Mon Sep 17 00:00:00 2001 From: gtully Date: Fri, 2 Dec 2016 13:57:44 +0000 Subject: [PATCH] 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 29ecfd6cdbad76617242ab91be5dd75a14a14425. --- .../org/apache/activemq/ActiveMQSession.java | 3 --- .../apache/activemq/JmsTopicRedeliverTest.java | 17 ----------------- 2 files changed, 20 deletions(-) diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java index 98484a55f4..6603a2f82f 100644 --- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java +++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java @@ -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) { diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicRedeliverTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicRedeliverTest.java index c80242c815..188e4cd89a 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicRedeliverTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JmsTopicRedeliverTest.java @@ -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");