activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r564814 [8/8] - in /activemq/trunk: activemq-core/src/main/java/org/apache/activemq/ activemq-core/src/main/java/org/apache/activemq/advisory/ activemq-core/src/main/java/org/apache/activemq/broker/ activemq-core/src/main/java/org/apache/ac...
Date Sat, 11 Aug 2007 00:49:31 GMT
Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsSendReceiveTestSupport.java Fri Aug 10 17:49:19 2007
@@ -50,7 +50,7 @@
     protected MessageProducer producer;
     protected Destination consumerDestination;
     protected Destination producerDestination;
-    protected List messages = createConcurrentList();
+    protected List<Message> messages = createConcurrentList();
     protected boolean topic = true;
     protected boolean durable;
     protected int deliveryMode = DeliveryMode.PERSISTENT;
@@ -152,12 +152,12 @@
      * @param receivedMessages
      * @throws JMSException
      */
-    protected void assertMessagesReceivedAreValid(List receivedMessages) throws JMSException {
-        List copyOfMessages = Arrays.asList(receivedMessages.toArray());
+    protected void assertMessagesReceivedAreValid(List<Message> receivedMessages) throws JMSException {
+        List<Object> copyOfMessages = Arrays.asList(receivedMessages.toArray());
         int counter = 0;
 
         if (data.length != copyOfMessages.size()) {
-            for (Iterator iter = copyOfMessages.iterator(); iter.hasNext();) {
+            for (Iterator<Object> iter = copyOfMessages.iterator(); iter.hasNext();) {
                 Object message = iter.next();
                 LOG.info("<== " + counter++ + " = " + message);
             }
@@ -166,7 +166,7 @@
         assertEquals("Not enough messages received", data.length, receivedMessages.size());
 
         for (int i = 0; i < data.length; i++) {
-            Message received = (Message)receivedMessages.get(i);
+            Message received = receivedMessages.get(i);
             assertMessageValid(i, received);
         }
     }
@@ -217,7 +217,7 @@
      * @param message - a newly received message.
      * @param messageList - list containing the received messages.
      */
-    protected void consumeMessage(Message message, List messageList) {
+    protected void consumeMessage(Message message, List<Message> messageList) {
         if (verbose) {
             LOG.info("Received message: " + message);
         }
@@ -236,7 +236,7 @@
      * 
      * @return a synchronized view of the specified list.
      */
-    protected List createConcurrentList() {
-        return Collections.synchronizedList(new ArrayList());
+    protected List<Message> createConcurrentList() {
+        return Collections.synchronizedList(new ArrayList<Message>());
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.java Fri Aug 10 17:49:19 2007
@@ -32,7 +32,7 @@
  * @version $Revision: 1.1 $
  */
 public class JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest extends JmsTopicSendReceiveWithTwoConnectionsAndEmbeddedBrokerTest {
-    private static final Log log = LogFactory.getLog(JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.class);
+    private static final Log LOG = LogFactory.getLog(JmsTopicSendReceiveWithEmbeddedBrokerAndUserIDTest.class);
 
     protected String userName = "James";
 
@@ -55,7 +55,7 @@
             Message message = (Message)iter.next();
             String userID = message.getStringProperty("JMSXUserID");
 
-            log.info("Received message with userID: " + userID);
+            LOG.info("Received message with userID: " + userID);
 
             assertEquals("JMSXUserID header", userName, userID);
         }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/test/message/NestedMapMessageTest.java Fri Aug 10 17:49:19 2007
@@ -76,11 +76,11 @@
 
         answer.setString("textField", data[index]);
 
-        Map grandChildMap = new HashMap();
+        Map<String, Object> grandChildMap = new HashMap<String, Object>();
         grandChildMap.put("x", "abc");
         grandChildMap.put("y", Arrays.asList(new Object[] {"a", "b", "c"}));
 
-        Map nestedMap = new HashMap();
+        Map<String, Object> nestedMap = new HashMap<String, Object>();
         nestedMap.put("a", "foo");
         nestedMap.put("b", Integer.valueOf(23));
         nestedMap.put("c", Long.valueOf(45));

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/StubTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/StubTransport.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/StubTransport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/StubTransport.java Fri Aug 10 17:49:19 2007
@@ -28,7 +28,7 @@
  */
 public class StubTransport extends TransportSupport {
 
-    private Queue queue = new ConcurrentLinkedQueue();
+    private Queue<Object> queue = new ConcurrentLinkedQueue<Object>();
 
     protected void doStop(ServiceStopper stopper) throws Exception {
     }
@@ -40,7 +40,7 @@
         queue.add(command);
     }
 
-    public Queue getQueue() {
+    public Queue<Object> getQueue() {
         return queue;
     }
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/TopicClusterTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/TopicClusterTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/TopicClusterTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/TopicClusterTest.java Fri Aug 10 17:49:19 2007
@@ -49,9 +49,9 @@
  */
 public class TopicClusterTest extends TestCase implements MessageListener {
     
-    private static final Log LOG = LogFactory.getLog(TopicClusterTest.class);
     protected static final int MESSAGE_COUNT = 50;
     protected static final int NUMBER_IN_CLUSTER = 3;
+    private static final Log LOG = LogFactory.getLog(TopicClusterTest.class);
     
     protected Destination destination;
     protected boolean topic = true;
@@ -59,13 +59,12 @@
     protected int deliveryMode = DeliveryMode.NON_PERSISTENT;
     protected MessageProducer[] producers;
     protected Connection[] connections;
-    protected List services = new ArrayList();
+    protected List<BrokerService> services = new ArrayList<BrokerService>();
 
     protected void setUp() throws Exception {
         connections = new Connection[NUMBER_IN_CLUSTER];
         producers = new MessageProducer[NUMBER_IN_CLUSTER];
         Destination destination = createDestination();
-        int portStart = 50000;
         String root = System.getProperty("activemq.store.dir");
         if (root == null) {
             root = "target/store";

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/TransportBrokerTestSupport.java Fri Aug 10 17:49:19 2007
@@ -29,7 +29,7 @@
 public abstract class TransportBrokerTestSupport extends BrokerTest {
 
     private TransportConnector connector;
-    ArrayList connections = new ArrayList();
+    private ArrayList<StubConnection> connections = new ArrayList<StubConnection>();
 
     protected void setUp() throws Exception {
         super.setUp();
@@ -44,8 +44,8 @@
     protected abstract String getBindLocation();
 
     protected void tearDown() throws Exception {
-        for (Iterator iter = connections.iterator(); iter.hasNext();) {
-            StubConnection connection = (StubConnection) iter.next();
+        for (Iterator<StubConnection> iter = connections.iterator(); iter.hasNext();) {
+            StubConnection connection = iter.next();
             connection.stop();
             iter.remove();
         }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/FailoverTransportBrokerTest.java Fri Aug 10 17:49:19 2007
@@ -83,7 +83,7 @@
         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;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/failover/ReconnectTest.java Fri Aug 10 17:49:19 2007
@@ -60,10 +60,11 @@
 
     class Worker implements Runnable, ExceptionListener {
 
-        private ActiveMQConnection connection;
-        private AtomicBoolean stop = new AtomicBoolean(false);
         public AtomicInteger iterations = new AtomicInteger();
         public CountDownLatch stopped = new CountDownLatch(1);
+
+        private ActiveMQConnection connection;
+        private AtomicBoolean stop = new AtomicBoolean(false);
         private Throwable error;
 
         public Worker() throws URISyntaxException, JMSException {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java Fri Aug 10 17:49:19 2007
@@ -44,13 +44,14 @@
 public class StompTest extends CombinationTestSupport {
     private static final Log LOG = LogFactory.getLog(StompTest.class);
 
+    protected String bindAddress = "stomp://localhost:0";
+
     private BrokerService broker;
     private TransportConnector connector;
     private StompConnection stompConnection = new StompConnection();
     private Connection connection;
     private Session session;
     private ActiveMQQueue queue;
-    protected String bindAddress = "stomp://localhost:0";
 
     protected void setUp() throws Exception {
         broker = new BrokerService();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslSocketHelper.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslSocketHelper.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslSocketHelper.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslSocketHelper.java Fri Aug 10 17:49:19 2007
@@ -25,8 +25,13 @@
 /**
  * @version $Revision$
  */
-public class SslSocketHelper {
-    public static SSLSocket createSSLSocket(String certDistinguishedName, boolean wantAuth, boolean needAuth) throws IOException {
+public final class SslSocketHelper {
+
+    private SslSocketHelper() {
+    }
+
+    public static SSLSocket createSSLSocket(String certDistinguishedName, boolean wantAuth, boolean needAuth)
+        throws IOException {
         JMXPrincipal principal = new JMXPrincipal(certDistinguishedName);
         X509Certificate cert = new StubX509Certificate(principal);
         StubSSLSession sslSession = new StubSSLSession(cert);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/SslTransportFactoryTest.java Fri Aug 10 17:49:19 2007
@@ -90,7 +90,7 @@
         // 2 transport options, 3 socket options, 3 settings for each option =>
         // 3^5 = 243 combos.
         for (int i = 0; i < 243; ++i) {
-            Map options = new HashMap();
+            Map<String, String> options = new HashMap<String, String>();
 
             for (int j = 0; j < 5; ++j) {
                 // -1 since the option range is [-1,1], not [0,2].

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubSSLSocket.java Fri Aug 10 17:49:19 2007
@@ -32,8 +32,7 @@
     private int wantClientAuthStatus = UNTOUCHED;
     private int needClientAuthStatus = UNTOUCHED;
     private int useClientModeStatus = UNTOUCHED;
-
-    final StubSSLSession session;
+    private final StubSSLSession session;
 
     public StubSSLSocket(StubSSLSession ses) {
         this.session = ses;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/tcp/StubX509Certificate.java Fri Aug 10 17:49:19 2007
@@ -25,6 +25,9 @@
 import java.util.Set;
 
 public class StubX509Certificate extends X509Certificate {
+    
+    private final Principal id;
+
     public StubX509Certificate(Principal id) {
         this.id = id;
     }
@@ -33,8 +36,6 @@
         return this.id;
     }
 
-    private final Principal id;
-
     // --- Stubbed Methods ---
     public void checkValidity() {
         // TODO Auto-generated method stub
@@ -146,11 +147,13 @@
         return false;
     }
 
+    @SuppressWarnings("unchecked")
     public Set getCriticalExtensionOIDs() {
         // TODO Auto-generated method stub
         return null;
     }
 
+    @SuppressWarnings("unchecked")
     public Set getNonCriticalExtensionOIDs() {
         // TODO Auto-generated method stub
         return null;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQFailoverIssue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQFailoverIssue.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQFailoverIssue.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQFailoverIssue.java Fri Aug 10 17:49:19 2007
@@ -18,6 +18,7 @@
 
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Random;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
@@ -108,7 +109,7 @@
         final UsageManager memoryManager = new UsageManager();
         memoryManager.setLimit(5000000);
         brokerService.setMemoryManager(memoryManager);
-        final ArrayList<PolicyEntry> policyEntries = new ArrayList<PolicyEntry>();
+        final List<PolicyEntry> policyEntries = new ArrayList<PolicyEntry>();
         final PolicyEntry entry = new PolicyEntry();
         entry.setQueue(">");
         // entry.setQueue(QUEUE1_NAME);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQStackOverFlowTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQStackOverFlowTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQStackOverFlowTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/AMQStackOverFlowTest.java Fri Aug 10 17:49:19 2007
@@ -19,6 +19,7 @@
 
 import java.net.URI;
 import java.util.ArrayList;
+import java.util.List;
 
 import javax.jms.JMSException;
 import javax.jms.Message;
@@ -120,7 +121,7 @@
         memoryManager.setLimit(10);
         brokerService.setMemoryManager(memoryManager);
 
-        final ArrayList<PolicyEntry> policyEntries = new ArrayList<PolicyEntry>();
+        final List<PolicyEntry> policyEntries = new ArrayList<PolicyEntry>();
 
         final PolicyEntry entry = new PolicyEntry();
         entry.setQueue(">");

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ChangeSentMessageTest.java Fri Aug 10 17:49:19 2007
@@ -47,7 +47,7 @@
         MessageConsumer consumer = consumerSession.createConsumer(destination);
         Session publisherSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer producer = publisherSession.createProducer(destination);
-        HashMap map = new HashMap();
+        HashMap<String, Integer> map = new HashMap<String, Integer>();
         ObjectMessage message = publisherSession.createObjectMessage();
         for (int i = 0; i < COUNT; i++) {
             map.put(VALUE_NAME, Integer.valueOf(i));

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CompositePublishTest.java Fri Aug 10 17:49:19 2007
@@ -93,7 +93,7 @@
         LOG.info("Started connections");
     }
 
-    protected MessageListener createMessageListener(int i, final List messageList) {
+    protected MessageListener createMessageListener(int i, final List<Message> messageList) {
         return new MessageListener() {
             public void onMessage(Message message) {
                 consumeMessage(message, messageList);
@@ -121,12 +121,12 @@
 
     protected void assertMessagesAreReceived() throws JMSException {
         waitForMessagesToBeDelivered();
-
-        for (int i = 0, size = messageLists.length; i < size; i++) {
+        int size = messageLists.length;
+        for (int i = 0; i < size; i++) {
             LOG.info("Message list: " + i + " contains: " + messageLists[i].size() + " message(s)");
         }
-
-        for (int i = 0, size = messageLists.length; i < size; i++) {
+        size = messageLists.length;
+        for (int i = 0; i < size; i++) {
             assertMessagesReceivedAreValid(messageLists[i]);
         }
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ConsumeTopicPrefetchTest.java Fri Aug 10 17:49:19 2007
@@ -22,11 +22,15 @@
 import javax.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnection;
+import org.apache.activemq.broker.policy.IndividualDeadLetterViaXmlTest;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * @version $Revision: 1.1.1.1 $
  */
 public class ConsumeTopicPrefetchTest extends ProducerConsumerTestSupport {
+    private static final Log LOG = LogFactory.getLog(ConsumeTopicPrefetchTest.class);
 
     protected int prefetchSize = 100;
     protected String[] messageTexts;
@@ -47,7 +51,7 @@
     protected void testWithMessageCount(int messageCount) throws JMSException {
         makeMessages(messageCount);
 
-        log.info("About to send and receive: " + messageCount + " on destination: " + destination
+        LOG.info("About to send and receive: " + messageCount + " on destination: " + destination
                 + " of type: " + destination.getClass().getName());
 
         for (int i = 0; i < messageCount; i++) {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/CreateTemporaryQueueBeforeStartTest.java Fri Aug 10 17:49:19 2007
@@ -56,9 +56,9 @@
         QueueConnection queueConnection = factory.createQueueConnection();
         this.connection = queueConnection;
         QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-        QueueSender sender = session.createSender(null); // Unidentified
+        session.createSender(null); // Unidentified
         Queue receiverQueue = session.createTemporaryQueue();
-        QueueReceiver receiver = session.createReceiver(receiverQueue);
+        session.createReceiver(receiverQueue);
         queueConnection.start();
     }
 
@@ -72,7 +72,7 @@
                         QueueConnection connection = createConnection();
                         QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                         Queue queue = session.createTemporaryQueue();
-                        QueueReceiver consumer = session.createReceiver(queue);
+                        session.createReceiver(queue);
                         connection.start();
 
                         if (count.incrementAndGet() >= number) {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsUsingTcpTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsUsingTcpTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsUsingTcpTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/MultiBrokersMultiClientsUsingTcpTest.java Fri Aug 10 17:49:19 2007
@@ -31,7 +31,7 @@
  * @version $Revision: 1.1.1.1 $
  */
 public class MultiBrokersMultiClientsUsingTcpTest extends MultiBrokersMultiClientsTest {
-    protected List bridges;
+    protected List<DemandForwardingBridge> bridges;
 
     protected void bridgeAllBrokers(String groupName) throws Exception {
         for (int i = 1; i <= BROKER_COUNT; i++) {
@@ -49,7 +49,8 @@
         List remoteTransports = remoteBroker.getTransportConnectors();
         List localTransports = localBroker.getTransportConnectors();
 
-        URI remoteURI, localURI;
+        URI remoteURI;
+        URI localURI;
         if (!remoteTransports.isEmpty() && !localTransports.isEmpty()) {
             remoteURI = ((TransportConnector)remoteTransports.get(0)).getConnectUri();
             localURI = ((TransportConnector)localTransports.get(0)).getConnectUri();
@@ -79,6 +80,6 @@
             ((BrokerItem)i.next()).broker.addConnector("tcp://localhost:" + (61616 + j++));
         }
 
-        bridges = new ArrayList();
+        bridges = new ArrayList<DemandForwardingBridge>();
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/PublishOnQueueConsumedMessageInTransactionTest.java Fri Aug 10 17:49:19 2007
@@ -50,7 +50,7 @@
     private MessageConsumer consumer;
     private Connection connection;
     private ObjectMessage objectMessage;
-    private List messages = createConcurrentList();
+    private List<Message> messages = createConcurrentList();
     private final Object lock = new Object();
     private String[] data;
     private String dataFileRoot = IOHelper.getDefaultDataDirectory();
@@ -134,7 +134,7 @@
         }
     }
 
-    protected void consumeMessage(Message message, List messageList) {
+    protected void consumeMessage(Message message, List<Message> messageList) {
         messageList.add(message);
         if (messageList.size() >= data.length) {
             synchronized (lock) {
@@ -144,8 +144,8 @@
 
     }
 
-    protected List createConcurrentList() {
-        return Collections.synchronizedList(new ArrayList());
+    protected List<Message> createConcurrentList() {
+        return Collections.synchronizedList(new ArrayList<Message>());
     }
 
     protected void waitForMessagesToBeDelivered() {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/QueueDuplicatesTest.java Fri Aug 10 17:49:19 2007
@@ -114,11 +114,9 @@
     }
 
     private class SendingThread extends Thread {
-        private String brokerUrl;
         private String subject;
 
         SendingThread(String brokerUrl, String subject) {
-            this.brokerUrl = brokerUrl;
             this.subject = subject;
             setDaemon(false);
         }
@@ -144,7 +142,7 @@
     }
 
     private static class SimpleConsumer implements MessageListener {
-        private Map msgs = new HashMap();
+        private Map<String, Message> msgs = new HashMap<String, Message>();
 
         public void onMessage(Message message) {
             LOG.info(formatter.format(new Date()) + " SimpleConsumer Message Received: " + message);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ReliableReconnectTest.java Fri Aug 10 17:49:19 2007
@@ -41,10 +41,11 @@
  * @version $Revision: 1.1.1.1 $
  */
 public class ReliableReconnectTest extends TestSupport {
-    private static final int RECEIVE_TIMEOUT = 10000;
+    
     protected static final int MESSAGE_COUNT = 100;
     protected static final String DEFAULT_BROKER_URL = "vm://localhost";
-    private IdGenerator idGen = new IdGenerator();
+    private static final int RECEIVE_TIMEOUT = 10000;
+    
     protected int deliveryMode = DeliveryMode.PERSISTENT;
     protected String consumerClientId;
     protected Destination destination;
@@ -52,6 +53,7 @@
     protected AtomicInteger messagesReceived = new AtomicInteger(0);
     protected BrokerService broker;
     protected int firstBatch = MESSAGE_COUNT / 10;
+    private IdGenerator idGen = new IdGenerator();
 
     public ReliableReconnectTest() {
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TestSupport.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TestSupport.java Fri Aug 10 17:49:19 2007
@@ -36,7 +36,9 @@
  * @version $Revision: 1.1.1.1 $
  */
 public class TestSupport extends TestCase {
-    protected Log log = LogFactory.getLog(getClass());
+    
+    private static final Log LOG = LogFactory.getLog(TestSupport.class);
+    
     protected ActiveMQConnectionFactory connectionFactory;
     protected boolean topic = true;
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkUsingTcpTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkUsingTcpTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkUsingTcpTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerQueueNetworkUsingTcpTest.java Fri Aug 10 17:49:19 2007
@@ -30,13 +30,14 @@
  * @version $Revision: 1.1.1.1 $
  */
 public class ThreeBrokerQueueNetworkUsingTcpTest extends ThreeBrokerQueueNetworkTest {
-    protected List bridges;
+    protected List<DemandForwardingBridge> bridges;
 
     protected void bridgeBrokers(BrokerService localBroker, BrokerService remoteBroker) throws Exception {
         List remoteTransports = remoteBroker.getTransportConnectors();
         List localTransports = localBroker.getTransportConnectors();
 
-        URI remoteURI, localURI;
+        URI remoteURI;
+        URI localURI;
         if (!remoteTransports.isEmpty() && !localTransports.isEmpty()) {
             remoteURI = ((TransportConnector)remoteTransports.get(0)).getConnectUri();
             localURI = ((TransportConnector)localTransports.get(0)).getConnectUri();
@@ -62,6 +63,6 @@
     public void setUp() throws Exception {
         super.setUp();
 
-        bridges = new ArrayList();
+        bridges = new ArrayList<DemandForwardingBridge>();
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkUsingTcpTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkUsingTcpTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkUsingTcpTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/ThreeBrokerTopicNetworkUsingTcpTest.java Fri Aug 10 17:49:19 2007
@@ -30,13 +30,14 @@
  * @version $Revision: 1.1.1.1 $
  */
 public class ThreeBrokerTopicNetworkUsingTcpTest extends ThreeBrokerTopicNetworkTest {
-    protected List bridges;
+    protected List<DemandForwardingBridge> bridges;
 
     protected void bridgeBrokers(BrokerService localBroker, BrokerService remoteBroker) throws Exception {
         List remoteTransports = remoteBroker.getTransportConnectors();
         List localTransports = localBroker.getTransportConnectors();
 
-        URI remoteURI, localURI;
+        URI remoteURI;
+        URI localURI;
         if (!remoteTransports.isEmpty() && !localTransports.isEmpty()) {
             remoteURI = ((TransportConnector)remoteTransports.get(0)).getConnectUri();
             localURI = ((TransportConnector)localTransports.get(0)).getConnectUri();
@@ -62,6 +63,6 @@
     public void setUp() throws Exception {
         super.setUp();
 
-        bridges = new ArrayList();
+        bridges = new ArrayList<DemandForwardingBridge>();
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TopicRedeliverTest.java Fri Aug 10 17:49:19 2007
@@ -35,8 +35,9 @@
 public class TopicRedeliverTest extends TestSupport {
 
     private static final int RECEIVE_TIMEOUT = 10000;
-    private IdGenerator idGen = new IdGenerator();
+
     protected int deliveryMode = DeliveryMode.PERSISTENT;
+    private IdGenerator idGen = new IdGenerator();
 
     public TopicRedeliverTest() {
     }
@@ -80,9 +81,9 @@
         sent1.setText("msg3");
         producer.send(sent3);
 
-        Message rec1 = consumer.receive(RECEIVE_TIMEOUT);
+        consumer.receive(RECEIVE_TIMEOUT);
         Message rec2 = consumer.receive(RECEIVE_TIMEOUT);
-        Message rec3 = consumer.receive(RECEIVE_TIMEOUT);
+        consumer.receive(RECEIVE_TIMEOUT);
 
         // ack rec2
         rec2.acknowledge();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TransactionRollbackOrderTest.java Fri Aug 10 17:49:19 2007
@@ -56,10 +56,10 @@
     private Connection connection;
     private CountDownLatch latch = new CountDownLatch(1);
     private int numMessages = 5;
-    private List msgSent = new ArrayList();
-    private List msgCommitted = new ArrayList();
-    private List msgRolledBack = new ArrayList();
-    private List msgRedelivered = new ArrayList();
+    private List<String> msgSent = new ArrayList<String>();
+    private List<String> msgCommitted = new ArrayList<String>();
+    private List<String> msgRolledBack = new ArrayList<String>();
+    private List<String> msgRedelivered = new ArrayList<String>();
 
     public void testTransaction() throws Exception {
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest.java Fri Aug 10 17:49:19 2007
@@ -39,7 +39,7 @@
 public class TwoBrokerMessageNotSentToRemoteWhenNoConsumerTest extends JmsMultipleBrokersTestSupport {
     protected static final int MESSAGE_COUNT = 10;
 
-    protected List bridges;
+    protected List<DemandForwardingBridge> bridges;
     protected AtomicInteger msgDispatchCount;
 
     /**
@@ -108,7 +108,8 @@
         List remoteTransports = remoteBroker.getTransportConnectors();
         List localTransports = localBroker.getTransportConnectors();
 
-        URI remoteURI, localURI;
+        URI remoteURI;
+        URI localURI;
         if (!remoteTransports.isEmpty() && !localTransports.isEmpty()) {
             remoteURI = ((TransportConnector)remoteTransports.get(0)).getConnectUri();
             localURI = ((TransportConnector)localTransports.get(0)).getConnectUri();
@@ -147,7 +148,7 @@
         createBroker(new URI("broker:(tcp://localhost:61616)/BrokerA?persistent=false&useJmx=false"));
         createBroker(new URI("broker:(tcp://localhost:61617)/BrokerB?persistent=false&useJmx=false"));
 
-        bridges = new ArrayList();
+        bridges = new ArrayList<DemandForwardingBridge>();
         msgDispatchCount = new AtomicInteger(0);
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerMulticastQueueTest.java Fri Aug 10 17:49:19 2007
@@ -42,7 +42,8 @@
     public static final int BROKER_COUNT = 2;
     public static final int CONSUMER_COUNT = 20;
 
-    public String sendUri, recvUri;
+    public String sendUri;
+    public String recvUri;
     private BrokerService[] brokers;
 
     public static Test suite() {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueClientsReconnectTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueClientsReconnectTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueClientsReconnectTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/TwoBrokerQueueClientsReconnectTest.java Fri Aug 10 17:49:19 2007
@@ -39,8 +39,10 @@
     private static final Log LOG = LogFactory.getLog(TwoBrokerQueueClientsReconnectTest.class);
 
 
-    protected int msgsClient1, msgsClient2;
-    protected String broker1, broker2;
+    protected int msgsClient1;
+    protected int msgsClient2;
+    protected String broker1;
+    protected String broker2;
 
     public void testClientAReceivesOnly() throws Exception {
         broker1 = "BrokerA";
@@ -353,7 +355,8 @@
         createBroker(new URI("broker:(tcp://localhost:61617)/BrokerB?persistent=false&useJmx=false"));
 
         // Configure broker connection factory
-        ActiveMQConnectionFactory factoryA, factoryB;
+        ActiveMQConnectionFactory factoryA;
+        ActiveMQConnectionFactory factoryB;
         factoryA = (ActiveMQConnectionFactory)getConnectionFactory("BrokerA");
         factoryB = (ActiveMQConnectionFactory)getConnectionFactory("BrokerB");
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/MessageIdList.java Fri Aug 10 17:49:19 2007
@@ -44,7 +44,7 @@
 
     private static final Log LOG = LogFactory.getLog(MessageIdList.class);
 
-    private List messageIds = new ArrayList();
+    private List<String> messageIds = new ArrayList<String>();
     private Object semaphore;
     private boolean verbose;
     private MessageListener parent;
@@ -84,17 +84,17 @@
     /**
      * @return all the messages on the list so far, clearing the buffer
      */
-    public List flushMessages() {
+    public List<String> flushMessages() {
         synchronized (semaphore) {
-            List answer = new ArrayList(messageIds);
+            List<String> answer = new ArrayList<String>(messageIds);
             messageIds.clear();
             return answer;
         }
     }
 
-    public synchronized List getMessageIds() {
+    public synchronized List<String> getMessageIds() {
         synchronized (semaphore) {
-            return new ArrayList(messageIds);
+            return new ArrayList<String>(messageIds);
         }
     }
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/ReflectionSupportTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/ReflectionSupportTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/ReflectionSupportTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/util/ReflectionSupportTest.java Fri Aug 10 17:49:19 2007
@@ -26,7 +26,7 @@
 
     public void testSetProperties() throws URISyntaxException {
         SimplePojo pojo = new SimplePojo();
-        HashMap map = new HashMap();        
+        HashMap<String, String> map = new HashMap<String, String>();        
         map.put("age", "27");
         map.put("name", "Hiram");
         map.put("enabled", "true");

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/ManagementContextXBeanConfigTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/ManagementContextXBeanConfigTest.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/ManagementContextXBeanConfigTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/xbean/ManagementContextXBeanConfigTest.java Fri Aug 10 17:49:19 2007
@@ -43,7 +43,7 @@
         MBeanServer beanServer = brokerService.getManagementContext().getMBeanServer();
 
         // Make sure the broker is registered in the right jmx domain.
-        Hashtable map = new Hashtable();
+        Hashtable<String, String> map = new Hashtable<String, String>();
         map.put("Type", "Broker");
         map.put("BrokerName", JMXSupport.encodeObjectNamePart("localhost"));
         ObjectName on = new ObjectName("test.domain", map);

Modified: activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java (original)
+++ activemq/trunk/activemq-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/CHeadersGenerator.java Fri Aug 10 17:49:19 2007
@@ -98,8 +98,8 @@
     /**
      * Sort the class list so that base classes come up first.
      */
-    protected List sort(List source) {
-        LinkedHashMap rc = new LinkedHashMap();
+    protected List<JClass> sort(List source) {
+        LinkedHashMap<JClass, JClass> rc = new LinkedHashMap<JClass, JClass>();
     	ArrayList classes = new ArrayList(source);
         Collections.sort(classes, new Comparator(){
 			public int compare(Object o1, Object o2) {
@@ -109,7 +109,7 @@
 			}});
     	
         // lets make a map of all the class names
-        HashMap classNames = new HashMap();
+        HashMap<JClass, JClass> classNames = new HashMap<JClass, JClass>();
         for (Iterator iter = classes.iterator(); iter.hasNext();) {
             JClass c = (JClass) iter.next();
             classNames.put(c, c);
@@ -129,7 +129,7 @@
                 rc.put(c,c);
         }
 
-        return new ArrayList(rc.keySet());
+        return new ArrayList<JClass>(rc.keySet());
     }
 
     void generateFields(PrintWriter out, JClass jclass) {
@@ -141,7 +141,7 @@
             generateFields(out, jclass.getSuperclass());
         }
 
-        ArrayList properties = new ArrayList();
+        ArrayList<JProperty> properties = new ArrayList<JProperty>();
         jclass.getDeclaredProperties();
         for (int i = 0; i < jclass.getDeclaredProperties().length; i++) {
             JProperty p = jclass.getDeclaredProperties()[i];
@@ -149,8 +149,8 @@
                 properties.add(p);
             }
         }
-        for (Iterator iter = properties.iterator(); iter.hasNext();) {
-            JProperty property = (JProperty) iter.next();
+        for (Iterator<JProperty> iter = properties.iterator(); iter.hasNext();) {
+            JProperty property = iter.next();
             JAnnotation annotation = property.getGetter().getAnnotation("openwire:property");
             JAnnotationValue size = annotation.getValue("size");
             String name = toPropertyCase(property.getSimpleName());

Modified: activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java?view=diff&rev=564814&r1=564813&r2=564814
==============================================================================
--- activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java (original)
+++ activemq/trunk/activemq-optional/src/main/java/org/apache/activemq/tool/AcidTestTool.java Fri Aug 10 17:49:19 2007
@@ -53,7 +53,6 @@
     private Random random = new Random();
     private byte data[];
     private int workerCount = 10;
-    private PrintWriter statWriter;
 
     // Worker configuration.
     protected int recordSize = 1024;
@@ -68,7 +67,7 @@
     AtomicInteger publishedBatches = new AtomicInteger(0);
     AtomicInteger consumedBatches = new AtomicInteger(0);
     
-    List errors = Collections.synchronizedList(new ArrayList());
+    List<Throwable> errors = Collections.synchronizedList(new ArrayList<Throwable>());
 
     private interface Worker extends Runnable {
         public boolean waitForExit(long i) throws InterruptedException;
@@ -80,11 +79,9 @@
         private MessageProducer producer;
         private BytesMessage message;
         CountDownLatch doneLatch = new CountDownLatch(1);
-        private final String workerId;
 
         ProducerWorker(Session session, String workerId) throws JMSException {
             this.session = session;
-            this.workerId = workerId;
             producer = session.createProducer(target);
             producer.setDeliveryMode(DeliveryMode.PERSISTENT);
             message = session.createBytesMessage();
@@ -141,11 +138,9 @@
         private MessageConsumer consumer;
         private final long timeout;
         CountDownLatch doneLatch = new CountDownLatch(1);
-        private final String workerId;
         
         ConsumerWorker(Session session, String workerId, long timeout) throws JMSException {
             this.session = session;
-            this.workerId = workerId;
             this.timeout = timeout;
             consumer = session.createConsumer(target,"workerId='"+workerId+"'");
         }
@@ -233,7 +228,6 @@
         }
         
         long reconnectDelay=1000;
-        JMSException lastError=null;
         
         while( connection == null) {
             if( reconnectDelay > 1000*10 ) {
@@ -243,7 +237,6 @@
 	            connection = factory.createConnection();
 	            connection.start();
 	        } catch (JMSException e) {
-                lastError = e;
 	            Thread.sleep(reconnectDelay);
 	            reconnectDelay*=2;
 	        }
@@ -272,7 +265,7 @@
         reconnect();
         
         System.out.println("Starting " + workerCount + " Workers...");
-        ArrayList workers = new ArrayList();
+        ArrayList<Worker> workers = new ArrayList<Worker>();
         for( int i=0; i< workerCount; i++ ){        
             String workerId = "worker-"+i;
             
@@ -302,8 +295,8 @@
 
         // Wait for all the workers to finish.
         System.out.println("Waiting for all workers to exit due to server shutdown.");
-        for (Iterator iter = workers.iterator(); iter.hasNext();) {
-            Worker worker = (Worker) iter.next();
+        for (Iterator<Worker> iter = workers.iterator(); iter.hasNext();) {
+            Worker worker = iter.next();
             while( !worker.waitForExit(1000) ) {
                 System.out.println("==============================================");
                 System.out.println("===> Server is under load now.  Kill it!");
@@ -315,7 +308,7 @@
         
         // No errors should have occured so far.
         if( errors.size()>0 )
-            throw (Throwable) errors.get(0);
+            throw errors.get(0);
         
         System.out.println("==============================================");
         System.out.println("===> Start the server now.");
@@ -333,8 +326,8 @@
         }
 
         System.out.println("Waiting for restarted consumers to finish consuming all messages..");
-        for (Iterator iter = workers.iterator(); iter.hasNext();) {
-            Worker worker = (Worker) iter.next();
+        for (Iterator<Worker> iter = workers.iterator(); iter.hasNext();) {
+            Worker worker = iter.next();
             while( !worker.waitForExit(1000*5) ) {
                 System.out.println("Waiting for restarted consumers to finish consuming all messages..");
                 System.out.println("Stats: Produced Batches: "+this.publishedBatches.get()+", Consumed Batches: "+this.consumedBatches.get());            
@@ -346,7 +339,7 @@
         System.out.println("Stats: Produced Batches: "+this.publishedBatches.get()+", Consumed Batches: "+this.consumedBatches.get());                    
         
         if( errors.size()>0 )
-            throw (Throwable) errors.get(0);
+            throw errors.get(0);
         
     }
     



Mime
View raw message