activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [02/32] activemq-artemis git commit: Remove unnecessary casts
Date Tue, 08 Dec 2015 00:12:28 GMT
Remove unnecessary casts


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3b5ee6c7
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3b5ee6c7
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3b5ee6c7

Branch: refs/heads/master
Commit: 3b5ee6c7ea8c071c5a335c343b8e44002b5b3ec4
Parents: b0007c4
Author: Ville Skyttä <ville.skytta@iki.fi>
Authored: Sun Dec 6 01:43:01 2015 +0200
Committer: Ville Skyttä <ville.skytta@iki.fi>
Committed: Mon Dec 7 22:53:42 2015 +0200

----------------------------------------------------------------------
 .../apache/activemq/artemis/boot/Artemis.java   |  2 +-
 .../apache/activemq/artemis/cli/Artemis.java    |  2 +-
 .../core/protocol/proton/TestConversions.java   |  2 +-
 .../protocol/openwire/OpenWireConnection.java   |  2 +-
 .../protocol/openwire/amq/AMQServerSession.java |  2 +-
 .../selector/filter/UnaryExpression.java        |  2 +-
 .../activemq/artemis/selector/SelectorTest.java |  8 ++++----
 .../core/server/impl/ServerSessionImpl.java     |  2 +-
 .../jms-to-rest/src/main/java/JmsReceive.java   |  2 +-
 .../rest/jms-to-rest/src/main/java/JmsSend.java |  2 +-
 .../rest/push/src/main/java/PostOrder.java      |  2 +-
 .../push/src/main/java/ReceiveShipping.java     |  2 +-
 .../transport/tcp/TcpTransportFactory.java      |  2 +-
 .../ActiveMQXAConnectionFactoryTest.java        |  2 +-
 .../activemq/JmsMultipleBrokersTestSupport.java |  2 +-
 .../org/apache/activemq/LoadTestBurnIn.java     |  2 +-
 .../activemq/MessageTransformationTest.java     | 20 ++++++++++----------
 .../activemq/PerDestinationStoreLimitTest.java  |  2 +-
 .../activemq/ProducerFlowControlTest.java       |  2 +-
 .../DurablePersistentFalseRestartTest.java      |  2 +-
 .../activemq/broker/MarshallingBrokerTest.java  |  2 +-
 .../broker/advisory/AdvisoryJmxTest.java        |  2 +-
 .../broker/jmx/MBeanOperationTimeoutTest.java   |  2 +-
 .../apache/activemq/broker/jmx/PurgeTest.java   | 12 ++++++------
 .../broker/policy/NoConsumerDeadLetterTest.java |  8 ++++----
 .../policy/StrictOrderDispatchPolicyTest.java   |  4 ++--
 .../DestinationInterceptorDurableSubTest.java   |  2 +-
 .../broker/virtual/VirtualTopicDLQTest.java     |  2 +-
 .../org/apache/activemq/bugs/AMQ1853Test.java   |  2 +-
 .../org/apache/activemq/bugs/AMQ2103Test.java   |  2 +-
 .../org/apache/activemq/bugs/AMQ2171Test.java   |  2 +-
 .../org/apache/activemq/bugs/AMQ3274Test.java   |  4 ++--
 .../org/apache/activemq/bugs/AMQ3674Test.java   |  2 +-
 .../org/apache/activemq/bugs/AMQ4950Test.java   |  2 +-
 .../OptimizeAcknowledgeWithExpiredMsgsTest.java |  2 +-
 .../bugs/RawRollbackSharedConsumerTests.java    |  2 +-
 .../apache/activemq/bugs/RawRollbackTests.java  |  2 +-
 .../command/ActiveMQMapMessageTest.java         |  2 +-
 .../command/ActiveMQStreamMessageTest.java      |  2 +-
 .../org/apache/activemq/spring/SpringTest.java  |  2 +-
 .../discovery/DiscoveryTransportBrokerTest.java |  2 +-
 .../fanout/FanoutTransportBrokerTest.java       |  2 +-
 ...ableSubscriberWithNetworkDisconnectTest.java |  2 +-
 .../usecases/MultiBrokersMultiClientsTest.java  |  2 +-
 .../MulticastDiscoveryOnFaultyNetworkTest.java  |  2 +-
 .../ObjectMessageNotSerializableTest.java       | 12 ++++++------
 .../activemq/usecases/TopicRedeliverTest.java   |  2 +-
 .../usecases/TwoBrokerQueueSendReceiveTest.java |  2 +-
 .../TwoBrokerTopicSendReceiveUsingTcpTest.java  |  4 ++--
 .../tests/extras/byteman/TimeoutXATest.java     |  2 +-
 .../interceptors/InterceptorTest.java           |  4 ++--
 .../jms/client/TopicCleanupTest.java            |  2 +-
 .../openwire/amq/JMSConsumer3Test.java          |  2 +-
 .../openwire/amq/JmsResourceProvider.java       |  4 ++--
 .../openwire/amq/JmsTopicRedeliverTest.java     |  2 +-
 .../openwire/amq/JmsTransactionTestSupport.java |  2 +-
 .../openwire/amq/ProducerFlowControlTest.java   |  2 +-
 .../openwire/interop/GeneralInteropTest.java    |  4 ++--
 .../PagingWithFailoverAndCountersTest.java      |  2 +-
 .../persistence/XmlImportExportTest.java        |  2 +-
 60 files changed, 91 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java
----------------------------------------------------------------------
diff --git a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java
index f2ee36f..b0458a2 100644
--- a/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java
+++ b/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java
@@ -48,7 +48,7 @@ public class Artemis {
 
    /** This is a good method for booting an embedded command */
    public static Object execute(File artemisHome, File artemisInstance, List<String> args) throws Throwable {
-      return execute(artemisHome, artemisInstance, (String[]) args.toArray(new String[args.size()]));
+      return execute(artemisHome, artemisInstance, args.toArray(new String[args.size()]));
    }
 
    /** This is a good method for booting an embedded command */

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
----------------------------------------------------------------------
diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
index ace192e..2faccf9 100644
--- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
+++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/Artemis.java
@@ -52,7 +52,7 @@ public class Artemis {
    }
 
    public static Object execute(File artemisHome, File artemisInstance, List<String> args) throws Exception {
-      return execute(artemisHome, artemisInstance, (String[]) args.toArray(new String[args.size()]));
+      return execute(artemisHome, artemisInstance, args.toArray(new String[args.size()]));
    }
 
    public static Object execute(File artemisHome, File artemisInstance, String... args) throws Exception {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java
index b563e61..de514bb 100644
--- a/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java
+++ b/artemis-protocols/artemis-amqp-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/proton/TestConversions.java
@@ -133,7 +133,7 @@ public class TestConversions extends Assert {
       AmqpValue value = (AmqpValue) outMessage.getBody();
       Map mapoutput = (Map) value.getValue();
 
-      assertEquals(Integer.valueOf(1), (Integer) mapoutput.get("someint"));
+      assertEquals(Integer.valueOf(1), mapoutput.get("someint"));
 
       System.out.println("output = " + obj);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index 4f1f0f6..0de5990 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -230,7 +230,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor, S
             }
             else {
                try {
-                  response = ((Command) command).visit(this);
+                  response = command.visit(this);
                }
                catch (Exception e) {
                   if (responseRequired) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java
index 2a39e03..08cb1ee 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/amq/AMQServerSession.java
@@ -355,7 +355,7 @@ public class AMQServerSession extends ServerSessionImpl {
                                         ManagementService managementService2,
                                         boolean supportLargeMessage,
                                         Integer credits) throws Exception {
-      return new AMQServerConsumer(consumerID, this, (QueueBinding) binding, filter, started, browseOnly, storageManager, callback, preAcknowledge, strictUpdateDeliveryCount, managementService, supportLargeMessage, credits);
+      return new AMQServerConsumer(consumerID, this, binding, filter, started, browseOnly, storageManager, callback, preAcknowledge, strictUpdateDeliveryCount, managementService, supportLargeMessage, credits);
    }
 
    public AMQServerConsumer getConsumer(long nativeId) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
----------------------------------------------------------------------
diff --git a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
index 6df808e..0c1e66f 100755
--- a/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
+++ b/artemis-selector/src/main/java/org/apache/activemq/artemis/selector/filter/UnaryExpression.java
@@ -105,7 +105,7 @@ public abstract class UnaryExpression implements Expression {
 
             int count = 0;
             for (Iterator<Object> i = inList.iterator(); i.hasNext(); ) {
-               Object o = (Object) i.next();
+               Object o = i.next();
                if (count != 0) {
                   answer.append(", ");
                }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java
----------------------------------------------------------------------
diff --git a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java
index 6808bdd..55c306c 100755
--- a/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java
+++ b/artemis-selector/src/test/java/org/apache/activemq/artemis/selector/SelectorTest.java
@@ -466,10 +466,10 @@ public class SelectorTest {
       message.setByteProperty("byteProp", (byte) 123);
       message.setByteProperty("byteProp2", (byte) 33);
       message.setShortProperty("shortProp", (short) 123);
-      message.setIntProperty("intProp", (int) 123);
-      message.setLongProperty("longProp", (long) 123);
-      message.setFloatProperty("floatProp", (float) 123);
-      message.setDoubleProperty("doubleProp", (double) 123);
+      message.setIntProperty("intProp", 123);
+      message.setLongProperty("longProp", 123);
+      message.setFloatProperty("floatProp", 123);
+      message.setDoubleProperty("doubleProp", 123);
 
       message.setIntProperty("rank", 123);
       message.setIntProperty("version", 2);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index 77345e3..26d9bb4 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -464,7 +464,7 @@ public class ServerSessionImpl implements ServerSession, FailureListener {
                                         ManagementService managementService2,
                                         boolean supportLargeMessage,
                                         Integer credits) throws Exception {
-      return new ServerConsumerImpl(consumerID, this, (QueueBinding) binding, filter, started, browseOnly, storageManager, callback, preAcknowledge, strictUpdateDeliveryCount, managementService, supportLargeMessage, credits);
+      return new ServerConsumerImpl(consumerID, this, binding, filter, started, browseOnly, storageManager, callback, preAcknowledge, strictUpdateDeliveryCount, managementService, supportLargeMessage, credits);
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
index d3c05b2..e5fa8ee 100644
--- a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
+++ b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsReceive.java
@@ -31,7 +31,7 @@ public class JmsReceive {
    public static void main(String[] args) throws Exception {
       System.out.println("Receive Setup...");
       ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
-      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
+      Destination destination = ActiveMQDestination.fromAddress("jms.queue.orders");
 
       Connection conn = factory.createConnection();
       try {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
index bf3370e..e3f9317 100644
--- a/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
+++ b/examples/features/standard/rest/jms-to-rest/src/main/java/JmsSend.java
@@ -28,7 +28,7 @@ public class JmsSend {
 
    public static void main(String[] args) throws Exception {
       ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
-      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
+      Destination destination = ActiveMQDestination.fromAddress("jms.queue.orders");
 
       Connection conn = factory.createConnection();
       try {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/examples/features/standard/rest/push/src/main/java/PostOrder.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/java/PostOrder.java b/examples/features/standard/rest/push/src/main/java/PostOrder.java
index 96786e6..ed128dd 100644
--- a/examples/features/standard/rest/push/src/main/java/PostOrder.java
+++ b/examples/features/standard/rest/push/src/main/java/PostOrder.java
@@ -28,7 +28,7 @@ public class PostOrder {
 
    public static void main(String[] args) throws Exception {
       ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
-      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.orders");
+      Destination destination = ActiveMQDestination.fromAddress("jms.queue.orders");
 
       Connection conn = factory.createConnection();
       try {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java b/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java
index 80a3892..679e94d 100644
--- a/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java
+++ b/examples/features/standard/rest/push/src/main/java/ReceiveShipping.java
@@ -30,7 +30,7 @@ public class ReceiveShipping {
 
    public static void main(String[] args) throws Exception {
       ConnectionFactory factory = JmsHelper.createConnectionFactory("activemq-client.xml");
-      Destination destination = (ActiveMQDestination) ActiveMQDestination.fromAddress("jms.queue.shipping");
+      Destination destination = ActiveMQDestination.fromAddress("jms.queue.shipping");
 
       Connection conn = factory.createConnection();
       try {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
index 73fbdcd..58d51ca 100644
--- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
+++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
@@ -98,7 +98,7 @@ public class TcpTransportFactory extends TransportFactory {
    @SuppressWarnings("rawtypes")
    public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
 
-      TcpTransport tcpTransport = (TcpTransport) transport.narrow(TcpTransport.class);
+      TcpTransport tcpTransport = transport.narrow(TcpTransport.class);
       IntrospectionSupport.setProperties(tcpTransport, options);
 
       Map<String, Object> socketOptions = IntrospectionSupport.extractProperties(options, "socket.");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
index 3ee3e85..9424598 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ActiveMQXAConnectionFactoryTest.java
@@ -491,7 +491,7 @@ public class ActiveMQXAConnectionFactoryTest extends CombinationTestSupport {
 
    private void assertTransactionGoneFromFailoverState(ActiveMQXAConnection connection1, Xid tid) throws Exception {
 
-      FailoverTransport transport = (FailoverTransport) connection1.getTransport().narrow(FailoverTransport.class);
+      FailoverTransport transport = connection1.getTransport().narrow(FailoverTransport.class);
       TransactionInfo info = new TransactionInfo(connection1.getConnectionInfo().getConnectionId(), new XATransactionId(tid), TransactionInfo.COMMIT_ONE_PHASE);
       assertNull("transaction should not exist in the state tracker", transport.getStateTracker().processCommitTransactionOnePhase(info));
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java
index 6e2d284..7848d6c 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsMultipleBrokersTestSupport.java
@@ -619,7 +619,7 @@ public class JmsMultipleBrokersTestSupport extends CombinationTestSupport {
       }
 
       public MessageConsumer createDurableSubscriber(Topic dest, Session sess, String name) throws Exception {
-         MessageConsumer client = sess.createDurableSubscriber((Topic) dest, name);
+         MessageConsumer client = sess.createDurableSubscriber(dest, name);
          MessageIdList messageIdList = new MessageIdList();
          messageIdList.setParent(allMessages);
          client.setMessageListener(messageIdList);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java
index 94bd3d5..2504765 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/LoadTestBurnIn.java
@@ -94,7 +94,7 @@ public class LoadTestBurnIn extends JmsTestSupport {
 
    @Override
    protected ConnectionFactory createConnectionFactory() throws URISyntaxException, IOException {
-      return new ActiveMQConnectionFactory(((TransportConnector) broker.getTransportConnectors().get(0)).getServer().getConnectURI());
+      return new ActiveMQConnectionFactory(broker.getTransportConnectors().get(0).getServer().getConnectURI());
    }
 
    public void initCombosForTestSendReceive() {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java
index 25a8fad..7ab95b3 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/MessageTransformationTest.java
@@ -64,30 +64,30 @@ public class MessageTransformationTest extends TestCase {
     * implementation.
     */
    public void testTransformDestination() throws Exception {
-      assertTrue("Transforming a TempQueue destination to an ActiveMQTempQueue", ActiveMQMessageTransformation.transformDestination((TemporaryQueue) new ActiveMQTempQueue()) instanceof ActiveMQTempQueue);
+      assertTrue("Transforming a TempQueue destination to an ActiveMQTempQueue", ActiveMQMessageTransformation.transformDestination(new ActiveMQTempQueue()) instanceof ActiveMQTempQueue);
 
-      assertTrue("Transforming a TempTopic destination to an ActiveMQTempTopic", ActiveMQMessageTransformation.transformDestination((TemporaryTopic) new ActiveMQTempTopic()) instanceof ActiveMQTempTopic);
+      assertTrue("Transforming a TempTopic destination to an ActiveMQTempTopic", ActiveMQMessageTransformation.transformDestination(new ActiveMQTempTopic()) instanceof ActiveMQTempTopic);
 
-      assertTrue("Transforming a Queue destination to an ActiveMQQueue", ActiveMQMessageTransformation.transformDestination((Queue) new ActiveMQQueue()) instanceof ActiveMQQueue);
+      assertTrue("Transforming a Queue destination to an ActiveMQQueue", ActiveMQMessageTransformation.transformDestination(new ActiveMQQueue()) instanceof ActiveMQQueue);
 
-      assertTrue("Transforming a Topic destination to an ActiveMQTopic", ActiveMQMessageTransformation.transformDestination((Topic) new ActiveMQTopic()) instanceof ActiveMQTopic);
+      assertTrue("Transforming a Topic destination to an ActiveMQTopic", ActiveMQMessageTransformation.transformDestination(new ActiveMQTopic()) instanceof ActiveMQTopic);
 
-      assertTrue("Transforming a Destination to an ActiveMQDestination", ActiveMQMessageTransformation.transformDestination((ActiveMQDestination) new ActiveMQTopic()) instanceof ActiveMQDestination);
+      assertTrue("Transforming a Destination to an ActiveMQDestination", ActiveMQMessageTransformation.transformDestination(new ActiveMQTopic()) instanceof ActiveMQDestination);
    }
 
    /**
     * Tests transforming messages into ActiveMQ's message implementation.
     */
    public void testTransformMessage() throws Exception {
-      assertTrue("Transforming a BytesMessage message into an ActiveMQBytesMessage", ActiveMQMessageTransformation.transformMessage((BytesMessage) new ActiveMQBytesMessage(), null) instanceof ActiveMQBytesMessage);
+      assertTrue("Transforming a BytesMessage message into an ActiveMQBytesMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQBytesMessage(), null) instanceof ActiveMQBytesMessage);
 
-      assertTrue("Transforming a MapMessage message to an ActiveMQMapMessage", ActiveMQMessageTransformation.transformMessage((MapMessage) new ActiveMQMapMessage(), null) instanceof ActiveMQMapMessage);
+      assertTrue("Transforming a MapMessage message to an ActiveMQMapMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQMapMessage(), null) instanceof ActiveMQMapMessage);
 
-      assertTrue("Transforming an ObjectMessage message to an ActiveMQObjectMessage", ActiveMQMessageTransformation.transformMessage((ObjectMessage) new ActiveMQObjectMessage(), null) instanceof ActiveMQObjectMessage);
+      assertTrue("Transforming an ObjectMessage message to an ActiveMQObjectMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQObjectMessage(), null) instanceof ActiveMQObjectMessage);
 
-      assertTrue("Transforming a StreamMessage message to an ActiveMQStreamMessage", ActiveMQMessageTransformation.transformMessage((StreamMessage) new ActiveMQStreamMessage(), null) instanceof ActiveMQStreamMessage);
+      assertTrue("Transforming a StreamMessage message to an ActiveMQStreamMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQStreamMessage(), null) instanceof ActiveMQStreamMessage);
 
-      assertTrue("Transforming a TextMessage message to an ActiveMQTextMessage", ActiveMQMessageTransformation.transformMessage((TextMessage) new ActiveMQTextMessage(), null) instanceof ActiveMQTextMessage);
+      assertTrue("Transforming a TextMessage message to an ActiveMQTextMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQTextMessage(), null) instanceof ActiveMQTextMessage);
 
       assertTrue("Transforming an ActiveMQMessage message to an ActiveMQMessage", ActiveMQMessageTransformation.transformMessage(new ActiveMQMessage(), null) instanceof ActiveMQMessage);
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/PerDestinationStoreLimitTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/PerDestinationStoreLimitTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/PerDestinationStoreLimitTest.java
index f55dee2..0f70d8f 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/PerDestinationStoreLimitTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/PerDestinationStoreLimitTest.java
@@ -190,7 +190,7 @@ public class PerDestinationStoreLimitTest extends JmsTestSupport {
    @Override
    protected void tearDown() throws Exception {
       if (connection != null) {
-         TcpTransport t = (TcpTransport) connection.getTransport().narrow(TcpTransport.class);
+         TcpTransport t = connection.getTransport().narrow(TcpTransport.class);
          t.getTransportListener().onException(new IOException("Disposed."));
          connection.getTransport().stop();
          super.tearDown();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ProducerFlowControlTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ProducerFlowControlTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ProducerFlowControlTest.java
index ea4bc16..0c6433e 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ProducerFlowControlTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/ProducerFlowControlTest.java
@@ -346,7 +346,7 @@ public class ProducerFlowControlTest extends JmsTestSupport {
    @Override
    protected void tearDown() throws Exception {
       if (connection != null) {
-         TcpTransport t = (TcpTransport) connection.getTransport().narrow(TcpTransport.class);
+         TcpTransport t = connection.getTransport().narrow(TcpTransport.class);
          t.getTransportListener().onException(new IOException("Disposed."));
          connection.getTransport().stop();
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/DurablePersistentFalseRestartTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/DurablePersistentFalseRestartTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/DurablePersistentFalseRestartTest.java
index a9bb7a9..1d1c7cf 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/DurablePersistentFalseRestartTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/DurablePersistentFalseRestartTest.java
@@ -59,7 +59,7 @@ public class DurablePersistentFalseRestartTest extends BrokerRestartTestSupport
       restartBroker();
 
       // make failover aware of the restarted auto assigned port
-      ((FailoverTransport) connection.getTransport().narrow(FailoverTransport.class)).add(true, broker.getTransportConnectors().get(0).getPublishableConnectString());
+      connection.getTransport().narrow(FailoverTransport.class).add(true, broker.getTransportConnectors().get(0).getPublishableConnectString());
 
       TextMessage msg = (TextMessage) consumer.receive(4000);
       assertNull("did not get a message when persistent=false, message: " + msg, msg);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/MarshallingBrokerTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/MarshallingBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/MarshallingBrokerTest.java
index ea37fb3..36c5e71 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/MarshallingBrokerTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/MarshallingBrokerTest.java
@@ -60,7 +60,7 @@ public class MarshallingBrokerTest extends BrokerTest {
          }
 
          protected void dispatch(Command command) throws InterruptedException, IOException {
-            super.dispatch((Command) wireFormat.unmarshal(wireFormat.marshal(command)));
+            super.dispatch(wireFormat.unmarshal(wireFormat.marshal(command)));
          }
 
          ;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/advisory/AdvisoryJmxTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/advisory/AdvisoryJmxTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/advisory/AdvisoryJmxTest.java
index ae41515..ca73238 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/advisory/AdvisoryJmxTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/advisory/AdvisoryJmxTest.java
@@ -50,7 +50,7 @@ public class AdvisoryJmxTest extends EmbeddedBrokerTestSupport {
       connector.connect();
       MBeanServerConnection connection = connector.getMBeanServerConnection();
       ObjectName name = new ObjectName("org.apache.activemq:type=Broker,brokerName=localhost");
-      BrokerViewMBean brokerMbean = (BrokerViewMBean) MBeanServerInvocationHandler.newProxyInstance(connection, name, BrokerViewMBean.class, true);
+      BrokerViewMBean brokerMbean = MBeanServerInvocationHandler.newProxyInstance(connection, name, BrokerViewMBean.class, true);
       Connection conn = createConnection();
       Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
       MessageConsumer consumer = sess.createConsumer(sess.createTopic("ActiveMQ.Advisory.Queue"));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
index cb26d86..5747efe 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
@@ -66,7 +66,7 @@ public class MBeanOperationTimeoutTest {
       objectNameStr += ",destinationType=Queue,destinationName=" + destinationName;
 
       ObjectName queueViewMBeanName = assertRegisteredObjectName(objectNameStr);
-      QueueViewMBean proxy = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
+      QueueViewMBean proxy = MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
 
       long count = proxy.getQueueSize();
       assertEquals("Queue size", count, messageCount);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java
index 24878a2..54e5793 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/jmx/PurgeTest.java
@@ -81,7 +81,7 @@ public class PurgeTest extends EmbeddedBrokerTestSupport {
       String objectNameStr = broker.getBrokerObjectName().toString();
       objectNameStr += ",destinationType=Queue,destinationName=" + getDestinationString();
       ObjectName queueViewMBeanName = assertRegisteredObjectName(objectNameStr);
-      QueueViewMBean proxy = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
+      QueueViewMBean proxy = MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
 
       long count = proxy.getQueueSize();
       assertEquals("Queue size", count, messageCount);
@@ -130,7 +130,7 @@ public class PurgeTest extends EmbeddedBrokerTestSupport {
       assertEquals(message, received);
 
       ObjectName brokerViewMBeanName = assertRegisteredObjectName(domain + ":type=Broker,brokerName=localhost");
-      BrokerViewMBean brokerProxy = (BrokerViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, brokerViewMBeanName, BrokerViewMBean.class, true);
+      BrokerViewMBean brokerProxy = MBeanServerInvocationHandler.newProxyInstance(mbeanServer, brokerViewMBeanName, BrokerViewMBean.class, true);
 
       brokerProxy.removeQueue(getDestinationString());
       producer.send(message);
@@ -153,10 +153,10 @@ public class PurgeTest extends EmbeddedBrokerTestSupport {
       // Now get the QueueViewMBean and purge
 
       ObjectName queueViewMBeanName = assertRegisteredObjectName(domain + ":type=Broker,brokerName=localhost,destinationType=Queue,destinationName=" + getDestinationString());
-      QueueViewMBean queueProxy = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
+      QueueViewMBean queueProxy = MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
 
       ObjectName brokerViewMBeanName = assertRegisteredObjectName(domain + ":type=Broker,brokerName=localhost");
-      BrokerViewMBean brokerProxy = (BrokerViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, brokerViewMBeanName, BrokerViewMBean.class, true);
+      BrokerViewMBean brokerProxy = MBeanServerInvocationHandler.newProxyInstance(mbeanServer, brokerViewMBeanName, BrokerViewMBean.class, true);
 
       long count = queueProxy.getQueueSize();
       assertEquals("Queue size", count, messageCount);
@@ -166,7 +166,7 @@ public class PurgeTest extends EmbeddedBrokerTestSupport {
       sendMessages(session, messageCount);
 
       queueViewMBeanName = assertRegisteredObjectName(domain + ":type=Broker,brokerName=localhost,destinationType=Queue,destinationName=" + getDestinationString());
-      queueProxy = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
+      queueProxy = MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
 
       count = queueProxy.getQueueSize();
       assertEquals("Queue size", count, messageCount);
@@ -186,7 +186,7 @@ public class PurgeTest extends EmbeddedBrokerTestSupport {
       sendMessages(session, messageCount);
 
       queueViewMBeanName = assertRegisteredObjectName(domain + ":type=Broker,brokerName=localhost,destinationType=Queue,destinationName=" + getDestinationString());
-      queueProxy = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
+      queueProxy = MBeanServerInvocationHandler.newProxyInstance(mbeanServer, queueViewMBeanName, QueueViewMBean.class, true);
 
       count = queueProxy.getQueueSize();
       assertEquals("Queue size", count, messageCount);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java
index 7258f42..3e4f0e4 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/NoConsumerDeadLetterTest.java
@@ -60,8 +60,8 @@ public class NoConsumerDeadLetterTest extends DeadLetterTestSupport {
 
    public void testConsumerReceivesMessages() throws Exception {
       this.topic = false;
-      ActiveMQConnectionFactory factory = (ActiveMQConnectionFactory) createConnectionFactory();
-      connection = (ActiveMQConnection) factory.createConnection();
+      ActiveMQConnectionFactory factory = createConnectionFactory();
+      connection = factory.createConnection();
       connection.start();
 
       Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -79,8 +79,8 @@ public class NoConsumerDeadLetterTest extends DeadLetterTestSupport {
 
       Thread.sleep(1000);
 
-      factory = (ActiveMQConnectionFactory) createConnectionFactory();
-      connection = (ActiveMQConnection) factory.createConnection();
+      factory = createConnectionFactory();
+      connection = factory.createConnection();
       connection.start();
 
       session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java
index 395c2ec..c655a48 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/policy/StrictOrderDispatchPolicyTest.java
@@ -122,10 +122,10 @@ public class StrictOrderDispatchPolicyTest extends TopicSubscriptionTest {
 
       // Get basis of order
       Iterator<MessageConsumer> i = consumers.keySet().iterator();
-      MessageIdList messageOrder = (MessageIdList) consumers.get(i.next());
+      MessageIdList messageOrder = consumers.get(i.next());
 
       for (; i.hasNext(); ) {
-         MessageIdList messageIdList = (MessageIdList) consumers.get(i.next());
+         MessageIdList messageIdList = consumers.get(i.next());
          assertTrue("Messages are not ordered.", messageOrder.equals(messageIdList));
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/DestinationInterceptorDurableSubTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/DestinationInterceptorDurableSubTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/DestinationInterceptorDurableSubTest.java
index 205a7b9..39e9d2a 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/DestinationInterceptorDurableSubTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/DestinationInterceptorDurableSubTest.java
@@ -173,7 +173,7 @@ public class DestinationInterceptorDurableSubTest extends EmbeddedBrokerTestSupp
          // AMQ-4571 only removed the latter not the former on unsubscribe(), so we need
          // to check against both.
          ObjectName[] names = (ObjectName[]) mbsc.getAttribute(new ObjectName(JMX_CONTEXT_BASE_NAME + topicName), "Subscriptions");
-         ObjectInstance instance = (ObjectInstance) mbsc.getObjectInstance(new ObjectName(JMX_CONTEXT_BASE_NAME +
+         ObjectInstance instance = mbsc.getObjectInstance(new ObjectName(JMX_CONTEXT_BASE_NAME +
                                                                                              topicName +
                                                                                              ",endpoint=Consumer,clientId=myId1,consumerId=Durable(myId1_" +
                                                                                              subName +

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicDLQTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicDLQTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicDLQTest.java
index 9e8974b..d05a5c7 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicDLQTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicDLQTest.java
@@ -265,7 +265,7 @@ public class VirtualTopicDLQTest extends TestCase {
             producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
 
             for (int i = 0; i < numberMessages; i++) {
-               TextMessage message = (TextMessage) session.createTextMessage("I am a message :: " + String.valueOf(i));
+               TextMessage message = session.createTextMessage("I am a message :: " + String.valueOf(i));
                try {
                   producer.send(message);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java
index 85d6c83..86326de 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ1853Test.java
@@ -194,7 +194,7 @@ public class AMQ1853Test {
             producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
 
             for (int i = 0; i < (producerMessages); i++) {
-               TextMessage message = (TextMessage) session.createTextMessage();
+               TextMessage message = session.createTextMessage();
                message.setLongProperty("TestTime", (System.currentTimeMillis()));
                try {
                   producer.send(message);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2103Test.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2103Test.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2103Test.java
index 2cb6ad0..906257a 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2103Test.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2103Test.java
@@ -75,7 +75,7 @@ public class AMQ2103Test extends BrokerTestSupport {
       factory.setCopyMessageOnSend(false);
 
       Connection connection = factory.createConnection();
-      Session session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
       ActiveMQDestination destination = new ActiveMQQueue("testQ");
       MessageConsumer consumer = session.createConsumer(destination);
       connection.start();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2171Test.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2171Test.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2171Test.java
index 510ccb1..52ee09b 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2171Test.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ2171Test.java
@@ -89,7 +89,7 @@ public class AMQ2171Test implements Thread.UncaughtExceptionHandler {
 
          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
          @SuppressWarnings("unchecked")
-         Enumeration<Message> unread = (Enumeration<Message>) session.createBrowser(destination).getEnumeration();
+         Enumeration<Message> unread = session.createBrowser(destination).getEnumeration();
 
          int count = 0;
          while (unread.hasMoreElements()) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3274Test.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3274Test.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3274Test.java
index 08c2f78..6c2405c 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3274Test.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3274Test.java
@@ -372,7 +372,7 @@ public class AMQ3274Test {
       org.apache.activemq.command.ActiveMQDestination dest;
 
       if (conn instanceof org.apache.activemq.ActiveMQConnection) {
-         dest = org.apache.activemq.command.ActiveMQDestination.createDestination(dest_name, (byte) org.apache.activemq.command.ActiveMQDestination.QUEUE_TYPE);
+         dest = org.apache.activemq.command.ActiveMQDestination.createDestination(dest_name, org.apache.activemq.command.ActiveMQDestination.QUEUE_TYPE);
          ((org.apache.activemq.ActiveMQConnection) conn).destroyDestination(dest);
       }
    }
@@ -381,7 +381,7 @@ public class AMQ3274Test {
       org.apache.activemq.command.ActiveMQDestination dest;
 
       if (conn instanceof org.apache.activemq.ActiveMQConnection) {
-         dest = org.apache.activemq.command.ActiveMQDestination.createDestination(dest_name, (byte) org.apache.activemq.command.ActiveMQDestination.TOPIC_TYPE);
+         dest = org.apache.activemq.command.ActiveMQDestination.createDestination(dest_name, org.apache.activemq.command.ActiveMQDestination.TOPIC_TYPE);
          ((org.apache.activemq.ActiveMQConnection) conn).destroyDestination(dest);
       }
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3674Test.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3674Test.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3674Test.java
index 8fc15dc..c691c42 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3674Test.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ3674Test.java
@@ -56,7 +56,7 @@ public class AMQ3674Test {
 
       consumerConnection.setClientID("subscriber1");
       Session consumerMQSession = consumerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-      TopicSubscriber activeConsumer = (TopicSubscriber) consumerMQSession.createDurableSubscriber(destination, "myTopic");
+      TopicSubscriber activeConsumer = consumerMQSession.createDurableSubscriber(destination, "myTopic");
       consumerConnection.start();
 
       Session session = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4950Test.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4950Test.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4950Test.java
index 1f4edc0..74d0817 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4950Test.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ4950Test.java
@@ -161,7 +161,7 @@ public class AMQ4950Test extends BrokerRestartTestSupport {
 
    private void assertTransactionGoneFromFailoverState(ActiveMQXAConnection connection1, Xid tid) throws Exception {
 
-      FailoverTransport transport = (FailoverTransport) connection1.getTransport().narrow(FailoverTransport.class);
+      FailoverTransport transport = connection1.getTransport().narrow(FailoverTransport.class);
       TransactionInfo info = new TransactionInfo(connection1.getConnectionInfo().getConnectionId(), new XATransactionId(tid), TransactionInfo.COMMIT_ONE_PHASE);
       assertNull("transaction should not exist in the state tracker", transport.getStateTracker().processCommitTransactionOnePhase(info));
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/OptimizeAcknowledgeWithExpiredMsgsTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/OptimizeAcknowledgeWithExpiredMsgsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/OptimizeAcknowledgeWithExpiredMsgsTest.java
index 6b624e2..4bc92ad 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/OptimizeAcknowledgeWithExpiredMsgsTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/OptimizeAcknowledgeWithExpiredMsgsTest.java
@@ -114,7 +114,7 @@ public class OptimizeAcknowledgeWithExpiredMsgsTest {
       MessageConsumer consumer = session.createConsumer(destination);
 
       final MyMessageListener listener = new MyMessageListener();
-      connection.setExceptionListener((ExceptionListener) listener);
+      connection.setExceptionListener(listener);
 
       // ***** Producer Code *****
       MessageProducer producer = session.createProducer(destination);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackSharedConsumerTests.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackSharedConsumerTests.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackSharedConsumerTests.java
index 56f0f6e..d458348 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackSharedConsumerTests.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackSharedConsumerTests.java
@@ -108,7 +108,7 @@ public class RawRollbackSharedConsumerTests {
       List<String> msgs = new ArrayList<String>();
       MessageConsumer consumer = session.createConsumer(queue);
       while (next != null) {
-         next = (String) receiveAndConvert(consumer);
+         next = receiveAndConvert(consumer);
          if (next != null)
             msgs.add(next);
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackTests.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackTests.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackTests.java
index f3a48ac..3c25220 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackTests.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/bugs/RawRollbackTests.java
@@ -108,7 +108,7 @@ public class RawRollbackTests {
       String next = "";
       List<String> msgs = new ArrayList<String>();
       while (next != null) {
-         next = (String) receiveAndConvert(session);
+         next = receiveAndConvert(session);
          if (next != null)
             msgs.add(next);
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java
index 4bc17a9..d180700 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQMapMessageTest.java
@@ -88,7 +88,7 @@ public class ActiveMQMapMessageTest extends TestCase {
       // Test with a 1Meg String
       StringBuffer bigSB = new StringBuffer(1024 * 1024);
       for (int i = 0; i < 1024 * 1024; i++) {
-         bigSB.append((char) 'a' + i % 26);
+         bigSB.append('a' + i % 26);
       }
       String bigString = bigSB.toString();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java
index 34ceb14..7cc5cc8 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/command/ActiveMQStreamMessageTest.java
@@ -678,7 +678,7 @@ public class ActiveMQStreamMessageTest extends TestCase {
          // Test with a 1Meg String
          StringBuffer bigSB = new StringBuffer(1024 * 1024);
          for (int i = 0; i < 1024 * 1024; i++) {
-            bigSB.append((char) 'a' + i % 26);
+            bigSB.append('a' + i % 26);
          }
          String bigString = bigSB.toString();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/spring/SpringTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/spring/SpringTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/spring/SpringTest.java
index fb48a5f..0d8886d 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/spring/SpringTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/spring/SpringTest.java
@@ -92,7 +92,7 @@ public class SpringTest extends SpringTestSupport {
       String config = "spring-start-false.xml";
       Thread.currentThread().setContextClassLoader(SpringTest.class.getClassLoader());
       context = new ClassPathXmlApplicationContext(config);
-      BrokerService broker = (BrokerService) context.getBean(BrokerService.class);
+      BrokerService broker = context.getBean(BrokerService.class);
       assertFalse("Broker is started", broker.isStarted());
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java
index e9bca3b..1238eac 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/discovery/DiscoveryTransportBrokerTest.java
@@ -86,7 +86,7 @@ public class DiscoveryTransportBrokerTest extends NetworkTestSupport {
       connection3.request(createMessage(producerInfo3, destination, deliveryMode));
 
       // The message will be sent to one of the brokers.
-      FailoverTransport ft = (FailoverTransport) connection3.getTransport().narrow(FailoverTransport.class);
+      FailoverTransport ft = connection3.getTransport().narrow(FailoverTransport.class);
 
       // See which broker we were connected to.
       StubConnection connectionA;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java
index a60325a..7e52f13 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/fanout/FanoutTransportBrokerTest.java
@@ -150,7 +150,7 @@ public class FanoutTransportBrokerTest extends NetworkTestSupport {
 
       // The MockTransport is on the remote connection.
       // Slip in a new transport filter after the MockTransport
-      MockTransport mt = (MockTransport) connection3.getTransport().narrow(MockTransport.class);
+      MockTransport mt = connection3.getTransport().narrow(MockTransport.class);
       mt.install(new TransportFilter(mt.getNext()) {
          @Override
          public void oneway(Object command) throws IOException {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberWithNetworkDisconnectTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberWithNetworkDisconnectTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberWithNetworkDisconnectTest.java
index 39a8e74..be0d631 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberWithNetworkDisconnectTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/DurableSubscriberWithNetworkDisconnectTest.java
@@ -211,7 +211,7 @@ public class DurableSubscriberWithNetworkDisconnectTest extends JmsMultipleBroke
       List<TransportConnector> transportConnectors = remoteBroker.getTransportConnectors();
       URI remoteURI;
       if (!transportConnectors.isEmpty()) {
-         remoteURI = ((TransportConnector) transportConnectors.get(0)).getConnectUri();
+         remoteURI = transportConnectors.get(0).getConnectUri();
          if (useSocketProxy) {
             socketProxy = new SocketProxy(remoteURI);
             remoteURI = socketProxy.getUrl();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java
index 5a7a427..0888ca2 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsTest.java
@@ -82,7 +82,7 @@ public class MultiBrokersMultiClientsTest extends JmsMultipleBrokersTestSupport
       // Get message count
       for (int i = 1; i <= BROKER_COUNT; i++) {
          for (int j = 0; j < CONSUMER_COUNT; j++) {
-            MessageIdList msgs = getConsumerMessages("Broker" + i, (MessageConsumer) consumerMap.get("Consumer:" + i + ":" + j));
+            MessageIdList msgs = getConsumerMessages("Broker" + i, consumerMap.get("Consumer:" + i + ":" + j));
             assertEquals(BROKER_COUNT * PRODUCER_COUNT * MESSAGE_COUNT, msgs.getMessageCount());
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MulticastDiscoveryOnFaultyNetworkTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MulticastDiscoveryOnFaultyNetworkTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MulticastDiscoveryOnFaultyNetworkTest.java
index 72c854a..d1e18e6 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MulticastDiscoveryOnFaultyNetworkTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/MulticastDiscoveryOnFaultyNetworkTest.java
@@ -122,7 +122,7 @@ public class MulticastDiscoveryOnFaultyNetworkTest extends JmsMultipleBrokersTes
       if (!useStaticDiscovery) {
          List<TransportConnector> transportConnectors = remoteBroker.getTransportConnectors();
          if (!transportConnectors.isEmpty()) {
-            TransportConnector mCastTrpConnector = ((TransportConnector) transportConnectors.get(0));
+            TransportConnector mCastTrpConnector = (transportConnectors.get(0));
             mCastTrpConnector.setDiscoveryUri(new URI("multicast://default?group=TESTERIC"));
          }
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/ObjectMessageNotSerializableTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/ObjectMessageNotSerializableTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/ObjectMessageNotSerializableTest.java
index d47c48e..ab21c0b 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/ObjectMessageNotSerializableTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/ObjectMessageNotSerializableTest.java
@@ -77,7 +77,7 @@ public class ObjectMessageNotSerializableTest extends CombinationTestSupport {
                factory.setCopyMessageOnSend(false);
 
                Connection connection = factory.createConnection();
-               Session session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                MessageConsumer consumer = session.createConsumer(destination);
                connection.start();
                consumerStarted.countDown();
@@ -106,7 +106,7 @@ public class ObjectMessageNotSerializableTest extends CombinationTestSupport {
                factory.setCopyMessageOnSend(false);
 
                Connection connection = factory.createConnection();
-               Session session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                MessageProducer producer = session.createProducer(destination);
                ActiveMQObjectMessage message = (ActiveMQObjectMessage) session.createObjectMessage();
                message.setObject(obj);
@@ -149,7 +149,7 @@ public class ObjectMessageNotSerializableTest extends CombinationTestSupport {
                factory.setCopyMessageOnSend(false);
 
                Connection connection = factory.createConnection();
-               Session session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                MessageConsumer consumer = session.createConsumer(destination);
                connection.start();
                consumerStarted.countDown();
@@ -177,7 +177,7 @@ public class ObjectMessageNotSerializableTest extends CombinationTestSupport {
                factory.setOptimizedMessageDispatch(true);
 
                Connection connection = factory.createConnection();
-               Session session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                MessageConsumer consumer = session.createConsumer(destination);
                connection.start();
                consumerStarted.countDown();
@@ -207,7 +207,7 @@ public class ObjectMessageNotSerializableTest extends CombinationTestSupport {
                factory.setCopyMessageOnSend(false);
 
                Connection connection = factory.createConnection();
-               Session session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                MessageConsumer consumer = session.createConsumer(destination);
                connection.start();
                consumerStarted.countDown();
@@ -236,7 +236,7 @@ public class ObjectMessageNotSerializableTest extends CombinationTestSupport {
                factory.setCopyMessageOnSend(false);
 
                Connection connection = factory.createConnection();
-               Session session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+               Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                MessageProducer producer = session.createProducer(destination);
                ActiveMQObjectMessage message = (ActiveMQObjectMessage) session.createObjectMessage();
                message.setObject(obj);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
index 0d86bbf..2c8f958 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
@@ -165,7 +165,7 @@ public class TopicRedeliverTest extends TestSupport {
       Session consumerSession = connection.createSession(true, Session.CLIENT_ACKNOWLEDGE);
       MessageConsumer consumer = null;
       if (topic) {
-         consumer = consumerSession.createConsumer((Topic) destination);
+         consumer = consumerSession.createConsumer(destination);
       }
       else {
          consumer = consumerSession.createConsumer(destination);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueSendReceiveTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueSendReceiveTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueSendReceiveTest.java
index c8bf46d..b7b5205 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueSendReceiveTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueSendReceiveTest.java
@@ -46,7 +46,7 @@ public class TwoBrokerQueueSendReceiveTest extends TwoBrokerTopicSendReceiveTest
       waitForMessagesToBeDelivered();
       assertEquals("Got all messages", data.length, messages.size());
 
-      BrokerService broker = (BrokerService) brokers.get("receiver");
+      BrokerService broker = brokers.get("receiver");
       final DemandForwardingBridgeSupport bridge = (DemandForwardingBridgeSupport) broker.getNetworkConnectors().get(0).activeBridges().toArray()[0];
       assertTrue("No extra, size:" + bridge.getLocalSubscriptionMap().size(), Wait.waitFor(new Wait.Condition() {
          @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java
index 987a534..fb91684 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/usecases/TwoBrokerTopicSendReceiveUsingTcpTest.java
@@ -62,7 +62,7 @@ public class TwoBrokerTopicSendReceiveUsingTcpTest extends TwoBrokerTopicSendRec
    @Override
    protected ActiveMQConnectionFactory createReceiverConnectionFactory() throws JMSException {
       try {
-         ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory(((TransportConnector) receiverBroker.getTransportConnectors().get(0)).getConnectUri());
+         ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory(receiverBroker.getTransportConnectors().get(0).getConnectUri());
          return fac;
       }
       catch (Exception e) {
@@ -74,7 +74,7 @@ public class TwoBrokerTopicSendReceiveUsingTcpTest extends TwoBrokerTopicSendRec
    @Override
    protected ActiveMQConnectionFactory createSenderConnectionFactory() throws JMSException {
       try {
-         ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory(((TransportConnector) senderBroker.getTransportConnectors().get(0)).getConnectUri());
+         ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory(senderBroker.getTransportConnectors().get(0).getConnectUri());
          return fac;
       }
       catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/TimeoutXATest.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/TimeoutXATest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/TimeoutXATest.java
index 462e9be..22611bc 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/TimeoutXATest.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/TimeoutXATest.java
@@ -97,7 +97,7 @@ public class TimeoutXATest extends ActiveMQTestBase {
             action = "afterRollback()")})
    public void testTimeoutOnTX2() throws Exception {
       ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
-      XAConnection connection = (XAConnection)connectionFactory.createXAConnection();
+      XAConnection connection = connectionFactory.createXAConnection();
 
       Connection connction2 = connectionFactory.createConnection();
       Session session = connection.createSession(true, Session.SESSION_TRANSACTED);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java
index 79d6c72..a894acb 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/interceptors/InterceptorTest.java
@@ -507,8 +507,8 @@ public class InterceptorTest extends ActiveMQTestBase {
    @Test
    public void testInterceptUsernameOnConsumer() throws Exception {
       ActiveMQJAASSecurityManager securityManager = (ActiveMQJAASSecurityManager) server.getSecurityManager();
-      ((SecurityConfiguration)securityManager.getConfiguration()).addUser("dumb", "dumber");
-      ((SecurityConfiguration)securityManager.getConfiguration()).addUser("an", "other");
+      securityManager.getConfiguration().addUser("dumb", "dumber");
+      securityManager.getConfiguration().addUser("an", "other");
 
       server.getRemotingService().addIncomingInterceptor(new InterceptUserOnCreateConsumer());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java
index 8ce9ced..3d27f12 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/TopicCleanupTest.java
@@ -131,7 +131,7 @@ public class TopicCleanupTest extends JMSTestBase {
          conn.close();
 
          boolean foundStrayRoutingBinding = false;
-         Bindings bindings = server.getPostOffice().getBindingsForAddress(new SimpleString(((ActiveMQTopic) topic).getAddress()));
+         Bindings bindings = server.getPostOffice().getBindingsForAddress(new SimpleString(topic.getAddress()));
          Map<SimpleString, List<Binding>> routingNames = ((BindingsImpl) bindings).getRoutingNameBindingMap();
          for (SimpleString key : routingNames.keySet()) {
             if (!key.toString().equals(topic.getAddress())) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java
index cc680f7..ae88bf8 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JMSConsumer3Test.java
@@ -58,7 +58,7 @@ public class JMSConsumer3Test extends BasicOpenWireTest {
    @Test
    public void testMutiReceiveWithPrefetch1() throws Exception {
       // Set prefetch to 1
-      ((ActiveMQConnection) connection).getPrefetchPolicy().setAll(1);
+      connection.getPrefetchPolicy().setAll(1);
       connection.start();
 
       // Use all the ack modes

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java
index ceeb6b9..47bdb23 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsResourceProvider.java
@@ -106,10 +106,10 @@ public class JmsResourceProvider {
     */
    public Destination createDestination(Session session, JmsTransactionTestSupport support) throws JMSException {
       if (isTopic) {
-         return (Destination) support.createDestination(session, ActiveMQDestination.TOPIC_TYPE);
+         return support.createDestination(session, ActiveMQDestination.TOPIC_TYPE);
       }
       else {
-         return (Destination) support.createDestination(session, ActiveMQDestination.QUEUE_TYPE);
+         return support.createDestination(session, ActiveMQDestination.QUEUE_TYPE);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java
index a758be7..cb018af 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTopicRedeliverTest.java
@@ -52,7 +52,7 @@ public class JmsTopicRedeliverTest extends BasicOpenWireTest {
    public void setUp() throws Exception {
       super.setUp();
 
-      initRedeliveryDelay = ((ActiveMQConnection) connection).getRedeliveryPolicy().getInitialRedeliveryDelay();
+      initRedeliveryDelay = connection.getRedeliveryPolicy().getInitialRedeliveryDelay();
 
       if (durable) {
          connection.setClientID(getClass().getName());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java
index 173fe0b..21e0444 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/JmsTransactionTestSupport.java
@@ -613,7 +613,7 @@ public abstract class JmsTransactionTestSupport extends BasicOpenWireTest implem
    }
 
    protected ActiveMQPrefetchPolicy getPrefetchPolicy() {
-      return ((ActiveMQConnection) connection).getPrefetchPolicy();
+      return connection.getPrefetchPolicy();
    }
 
    // This test won't work with xa tx so no beginTx() has been added.

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java
index 49feb26..c468773 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/amq/ProducerFlowControlTest.java
@@ -341,7 +341,7 @@ public class ProducerFlowControlTest extends BasicOpenWireTest {
    public void tearDown() throws Exception {
       try {
          if (flowControlConnection != null) {
-            TcpTransport t = (TcpTransport) flowControlConnection.getTransport().narrow(TcpTransport.class);
+            TcpTransport t = flowControlConnection.getTransport().narrow(TcpTransport.class);
             try {
                flowControlConnection.getTransport().stop();
                flowControlConnection.close();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
index 3f2b7b6..c186ed5 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/interop/GeneralInteropTest.java
@@ -289,7 +289,7 @@ public class GeneralInteropTest extends BasicOpenWireTest {
          msg.writeByte((byte) 2);
          msg.writeBytes(new byte[]{6, 7});
          msg.writeChar('b');
-         msg.writeDouble((double) 6.5);
+         msg.writeDouble(6.5);
          msg.writeFloat((float) 93.9);
          msg.writeInt(7657);
          msg.writeLong(239999L);
@@ -566,7 +566,7 @@ public class GeneralInteropTest extends BasicOpenWireTest {
       streamMessage.writeByte((byte) 2);
       streamMessage.writeBytes(new byte[]{6, 7});
       streamMessage.writeChar('b');
-      streamMessage.writeDouble((double) 6.5);
+      streamMessage.writeDouble(6.5);
       streamMessage.writeFloat((float) 93.9);
       streamMessage.writeInt(7657);
       streamMessage.writeLong(239999L);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3b5ee6c7/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java
index 88730f3..1bc5ef6 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java
@@ -357,7 +357,7 @@ public class PagingWithFailoverAndCountersTest extends ActiveMQTestBase {
       waitForServerToStart(server);
       Queue queue = server.locateQueue(SimpleString.toSimpleString("cons2"));
 
-      int messageCount = (int) getMessageCount(queue);
+      int messageCount = getMessageCount(queue);
 
       assertTrue(messageCount >= 0);
 


Mime
View raw message