Remove dead code

This commit is contained in:
Ville Skyttä 2016-01-09 13:55:44 +02:00 committed by Clebert Suconic
parent cfff68f2d0
commit 66e82be652
7 changed files with 29 additions and 99 deletions

View File

@ -623,12 +623,12 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
@Override
public QueueQueryResult executeQueueQuery(final SimpleString name) throws Exception {
boolean autoCreateJmsQueues = name.toString().startsWith(ResourceNames.JMS_QUEUE) && server.getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateJmsQueues();
if (name == null) {
throw ActiveMQMessageBundle.BUNDLE.queueNameIsNull();
}
boolean autoCreateJmsQueues = name.toString().startsWith(ResourceNames.JMS_QUEUE) && server.getAddressSettingsRepository().getMatch(name.toString()).isAutoCreateJmsQueues();
QueueQueryResult response;
Binding binding = postOffice.getBinding(name);
@ -658,12 +658,12 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
@Override
public BindingQueryResult executeBindingQuery(final SimpleString address) throws Exception {
boolean autoCreateJmsQueues = address.toString().startsWith(ResourceNames.JMS_QUEUE) && server.getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateJmsQueues();
if (address == null) {
throw ActiveMQMessageBundle.BUNDLE.addressIsNull();
}
boolean autoCreateJmsQueues = address.toString().startsWith(ResourceNames.JMS_QUEUE) && server.getAddressSettingsRepository().getMatch(address.toString()).isAutoCreateJmsQueues();
List<SimpleString> names = new ArrayList<>();
// make an exception for the management address (see HORNETQ-29)

View File

@ -23,7 +23,6 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.jms.Topic;
import javax.naming.InitialContext;
import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
@ -39,10 +38,6 @@ public class ClusteredTopicExample {
Connection connection1 = null;
InitialContext ic0 = null;
InitialContext ic1 = null;
try {
// Step 1. Instantiate topic
@ -116,14 +111,6 @@ public class ClusteredTopicExample {
if (connection1 != null) {
connection1.close();
}
if (ic0 != null) {
ic0.close();
}
if (ic1 != null) {
ic1.close();
}
}
}
}

View File

@ -90,9 +90,6 @@ public class AMQ2401Test extends TestCase implements MessageListener {
public void testDupsOk() throws Exception {
TestProducer p = null;
TestConsumer c = null;
try {
latch = new CountDownLatch(SEND_COUNT);
for (int i = 0; i < CONSUMER_COUNT; i++) {
@ -108,16 +105,6 @@ public class AMQ2401Test extends TestCase implements MessageListener {
waitForMessageReceipt(TimeUnit.SECONDS.toMillis(30));
}
finally {
if (p != null) {
p.close();
}
if (c != null) {
c.close();
}
}
}
@Override
public void onMessage(Message message) {

View File

@ -128,9 +128,6 @@ public class AMQ2413Test extends CombinationTestSupport implements MessageListen
public void testReceipt() throws Exception {
running.set(true);
TestProducer p = null;
TestConsumer c = null;
try {
for (int i = 0; i < CONSUMER_COUNT; i++) {
TestConsumer consumer = new TestConsumer();
@ -142,19 +139,8 @@ public class AMQ2413Test extends CombinationTestSupport implements MessageListen
producer.start();
services.add(producer);
}
waitForMessageReceipt();
}
finally {
if (p != null) {
p.close();
}
if (c != null) {
c.close();
}
}
}
/*

View File

@ -22,7 +22,6 @@ import java.util.List;
import java.util.Map;
import org.apache.activemq.artemis.api.core.TransportConfiguration;
import org.apache.activemq.artemis.api.core.client.ServerLocator;
import org.apache.activemq.artemis.core.config.BridgeConfiguration;
import org.apache.activemq.artemis.core.config.CoreQueueConfiguration;
import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
@ -75,7 +74,6 @@ public class BridgeServerLocatorConfigurationTest extends ActiveMQTestBase {
server1Params.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
}
ActiveMQServer server1 = createClusteredServerWithParams(isNetty(), 1, true, server1Params);
ServerLocator locator = null;
try {
final String testAddress = "testAddress";
final String queueName0 = "queue0";
@ -118,10 +116,6 @@ public class BridgeServerLocatorConfigurationTest extends ActiveMQTestBase {
assertEquals(BRIDGE_TTL, bridgeTTL);
}
finally {
if (locator != null) {
locator.close();
}
serverWithBridge.stop();
server1.stop();

View File

@ -31,8 +31,6 @@ import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicSubscriber;
import javax.naming.Context;
import javax.naming.NamingException;
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
import org.apache.activemq.artemis.tests.util.JMSTestBase;
@ -290,7 +288,6 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
@Test
public void testFlowControl() {
Context context = null;
try {
LoadProducer producer = new LoadProducer("producer", topic, cf, FlowControlOnIgnoreLargeMessageBodyTest.TOTAL_MESSAGES_COUNT);
@ -341,16 +338,6 @@ public class FlowControlOnIgnoreLargeMessageBodyTest extends JMSTestBase {
catch (Exception e) {
log.warn(e.getMessage(), e);
}
finally {
if (context != null) {
try {
context.close();
}
catch (NamingException ex) {
log.warn(ex.getMessage(), ex);
}
}
}
}
}

View File

@ -25,7 +25,6 @@ import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
import javax.jms.Connection;
import javax.jms.ConnectionMetaData;
import org.junit.Assert;
@ -61,10 +60,6 @@ public class ManifestTest extends ActiveMQTestBase {
JarFile jar = new JarFile(file);
Manifest manifest = jar.getManifest();
// Open a connection and get ConnectionMetaData
Connection conn = null;
try {
ActiveMQServer server = ActiveMQServers.newActiveMQServer(createBasicConfig());
ConnectionMetaData meta = new ActiveMQConnectionMetaData(server.getVersion());
@ -74,12 +69,6 @@ public class ManifestTest extends ActiveMQTestBase {
Assert.assertEquals(meta.getProviderVersion(), attrs.getValue("ActiveMQ-Version"));
}
finally {
if (conn != null) {
conn.close();
}
}
}
// Package protected ---------------------------------------------