You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2007/08/09 02:34:40 UTC

svn commit: r564057 [9/13] - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/ main/java/org/apache/activemq/advisory/ main/java/org/apache/activemq/blob/ main/java/org/apache/activemq/broker/ main/java/org/apache/activemq/broker/ft/...

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/FrameTranslator.java Wed Aug  8 17:34:07 2007
@@ -1,13 +1,14 @@
 package org.apache.activemq.transport.stomp;
 
-import org.apache.activemq.command.ActiveMQMessage;
-import org.apache.activemq.command.ActiveMQDestination;
-
-import javax.jms.JMSException;
-import javax.jms.Destination;
 import java.io.IOException;
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Destination;
+import javax.jms.JMSException;
+
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQMessage;
 
 /**
  * Implementations of this interface are used to map back and forth from Stomp

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/LegacyFrameTranslator.java Wed Aug  8 17:34:07 2007
@@ -1,15 +1,16 @@
 package org.apache.activemq.transport.stomp;
 
-import org.apache.activemq.command.ActiveMQMessage;
-import org.apache.activemq.command.ActiveMQBytesMessage;
-import org.apache.activemq.command.ActiveMQTextMessage;
-import org.apache.activemq.command.ActiveMQDestination;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
 
-import javax.jms.JMSException;
 import javax.jms.Destination;
-import java.util.Map;
-import java.util.HashMap;
-import java.io.IOException;
+import javax.jms.JMSException;
+
+import org.apache.activemq.command.ActiveMQBytesMessage;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQMessage;
+import org.apache.activemq.command.ActiveMQTextMessage;
 
 /**
  * Implements ActiveMQ 4.0 translations

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/ProtocolConverter.java Wed Aug  8 17:34:07 2007
@@ -22,14 +22,13 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicBoolean;
 
-import javax.jms.Destination;
 import javax.jms.JMSException;
 
-import org.apache.activemq.command.ActiveMQBytesMessage;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQMessage;
-import org.apache.activemq.command.ActiveMQTextMessage;
 import org.apache.activemq.command.Command;
 import org.apache.activemq.command.ConnectionId;
 import org.apache.activemq.command.ConnectionInfo;
@@ -51,9 +50,6 @@
 import org.apache.activemq.util.IdGenerator;
 import org.apache.activemq.util.IntrospectionSupport;
 import org.apache.activemq.util.LongSequenceGenerator;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * @author <a href="http://hiramchirino.com">chirino</a>

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSslTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSslTransportFactory.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSslTransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSslTransportFactory.java Wed Aug  8 17:34:07 2007
@@ -25,7 +25,7 @@
 
 /**
  * A <a href="http://stomp.codehaus.org/">STOMP</a> over SSL transport factory
- *
+ * 
  * @version $Revision$
  */
 public class StompSslTransportFactory extends SslTransportFactory {
@@ -35,8 +35,8 @@
     }
 
     public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
-    	transport = new StompTransportFilter(transport, new LegacyFrameTranslator());
-    	IntrospectionSupport.setProperties(transport, options);
-    	return super.compositeConfigure(transport, format, options);
+        transport = new StompTransportFilter(transport, new LegacyFrameTranslator());
+        IntrospectionSupport.setProperties(transport, options);
+        return super.compositeConfigure(transport, format, options);
     }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompTransportFactory.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompTransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompTransportFactory.java Wed Aug  8 17:34:07 2007
@@ -25,7 +25,7 @@
 
 /**
  * A <a href="http://stomp.codehaus.org/">STOMP</a> transport factory
- *
+ * 
  * @version $Revision: 1.1.1.1 $
  */
 public class StompTransportFactory extends TcpTransportFactory {
@@ -35,13 +35,14 @@
     }
 
     public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
-    	transport = new StompTransportFilter(transport, new LegacyFrameTranslator());
-    	IntrospectionSupport.setProperties(transport, options);
-    	return super.compositeConfigure(transport, format, options);
+        transport = new StompTransportFilter(transport, new LegacyFrameTranslator());
+        IntrospectionSupport.setProperties(transport, options);
+        return super.compositeConfigure(transport, format, options);
     }
 
     protected boolean isUseInactivityMonitor(Transport transport) {
-        // lets disable the inactivity monitor as stomp does not use keep alive packets
+        // lets disable the inactivity monitor as stomp does not use keep alive
+        // packets
         return false;
     }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ResponseHolder.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ResponseHolder.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ResponseHolder.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/ResponseHolder.java Wed Aug  8 17:34:07 2007
@@ -36,7 +36,7 @@
 
     /**
      * Set the Response for this holder
-     *
+     * 
      * @param r
      */
     public void setResponse(Response r) {
@@ -58,7 +58,7 @@
 
     /**
      * wait upto <Code>timeout</Code> timeout ms to get a receipt
-     *
+     * 
      * @param timeout
      * @return
      */
@@ -67,8 +67,7 @@
             if (!notified) {
                 try {
                     lock.wait(timeout);
-                }
-                catch (InterruptedException e) {
+                } catch (InterruptedException e) {
                     Thread.currentThread().interrupt();
                 }
             }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransport.java Wed Aug  8 17:34:07 2007
@@ -17,10 +17,6 @@
 
 package org.apache.activemq.transport.tcp;
 
-import org.apache.activemq.command.Command;
-import org.apache.activemq.command.ConnectionInfo;
-import org.apache.activemq.wireformat.WireFormat;
-
 import java.io.IOException;
 import java.net.URI;
 import java.net.UnknownHostException;
@@ -30,6 +26,10 @@
 import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
+
+import org.apache.activemq.command.Command;
+import org.apache.activemq.command.ConnectionInfo;
+import org.apache.activemq.wireformat.WireFormat;
 
 /**
  * A Transport class that uses SSL and client-side certificate authentication.

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportFactory.java Wed Aug  8 17:34:07 2007
@@ -16,19 +16,6 @@
  */
 package org.apache.activemq.transport.tcp;
 
-import org.apache.activemq.wireformat.WireFormat;
-import org.apache.activemq.openwire.OpenWireFormat;
-import org.apache.activemq.transport.InactivityMonitor;
-import org.apache.activemq.transport.Transport;
-import org.apache.activemq.transport.TransportLogger;
-import org.apache.activemq.transport.TransportServer;
-import org.apache.activemq.transport.WireFormatNegotiator;
-import org.apache.activemq.util.IOExceptionSupport;
-import org.apache.activemq.util.IntrospectionSupport;
-import org.apache.activemq.util.URISupport;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -37,17 +24,29 @@
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 
 import javax.net.ServerSocketFactory;
 import javax.net.SocketFactory;
-import javax.net.ssl.SSLContext;
 import javax.net.ssl.KeyManager;
+import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLServerSocketFactory;
 import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManager;
 
+import org.apache.activemq.openwire.OpenWireFormat;
+import org.apache.activemq.transport.InactivityMonitor;
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.transport.TransportLogger;
+import org.apache.activemq.transport.TransportServer;
+import org.apache.activemq.transport.WireFormatNegotiator;
+import org.apache.activemq.util.IOExceptionSupport;
+import org.apache.activemq.util.IntrospectionSupport;
+import org.apache.activemq.util.URISupport;
+import org.apache.activemq.wireformat.WireFormat;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
  * An implementation of the TcpTransportFactory using SSL. The major
  * contribution from this class is that it is aware of SslTransportServer and
@@ -127,7 +126,7 @@
         if (path != null && path.length() > 0) {
             int localPortIndex = path.indexOf(':');
             try {
-                Integer.parseInt(path.substring((localPortIndex + 1), path.length()));
+                Integer.parseInt(path.substring(localPortIndex + 1, path.length()));
                 String localString = location.getScheme() + ":/" + path;
                 localLocation = new URI(localString);
             } catch (Exception e) {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/SslTransportServer.java Wed Aug  8 17:34:07 2007
@@ -17,9 +17,6 @@
 
 package org.apache.activemq.transport.tcp;
 
-import org.apache.activemq.wireformat.WireFormat;
-import org.apache.activemq.transport.Transport;
-
 import java.io.IOException;
 import java.net.Socket;
 import java.net.URI;
@@ -28,6 +25,9 @@
 import javax.net.ssl.SSLServerSocket;
 import javax.net.ssl.SSLServerSocketFactory;
 import javax.net.ssl.SSLSocket;
+
+import org.apache.activemq.transport.Transport;
+import org.apache.activemq.wireformat.WireFormat;
 
 /**
  *  An SSL TransportServer.

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportFactory.java Wed Aug  8 17:34:07 2007
@@ -113,7 +113,7 @@
         if (path != null && path.length() > 0) {
             int localPortIndex = path.indexOf(':');
             try {
-                Integer.parseInt(path.substring((localPortIndex + 1), path.length()));
+                Integer.parseInt(path.substring(localPortIndex + 1, path.length()));
                 String localString = location.getScheme() + ":/" + path;
                 localLocation = new URI(localString);
             } catch (Exception e) {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java Wed Aug  8 17:34:07 2007
@@ -28,6 +28,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.net.ServerSocketFactory;
+
 import org.apache.activemq.command.BrokerInfo;
 import org.apache.activemq.openwire.OpenWireFormatFactory;
 import org.apache.activemq.transport.Transport;
@@ -39,8 +41,6 @@
 import org.apache.activemq.wireformat.WireFormatFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import javax.net.ServerSocketFactory;
 
 /**
  * A TCP based implementation of {@link TransportServer}

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/ByteBufferPool.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/ByteBufferPool.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/ByteBufferPool.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/ByteBufferPool.java Wed Aug  8 17:34:07 2007
@@ -16,9 +16,9 @@
  */
 package org.apache.activemq.transport.udp;
 
-import org.apache.activemq.Service;
-
 import java.nio.ByteBuffer;
+
+import org.apache.activemq.Service;
 
 /**
  * Represents a pool of {@link ByteBuffer} instances. 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannel.java Wed Aug  8 17:34:07 2007
@@ -16,13 +16,13 @@
  */
 package org.apache.activemq.transport.udp;
 
+import java.io.IOException;
+import java.net.SocketAddress;
+
 import org.apache.activemq.Service;
 import org.apache.activemq.command.Command;
 import org.apache.activemq.transport.reliable.ReplayBuffer;
 import org.apache.activemq.transport.reliable.Replayer;
-
-import java.io.IOException;
-import java.net.SocketAddress;
 
 /**
  *

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannelSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannelSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannelSupport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandChannelSupport.java Wed Aug  8 17:34:07 2007
@@ -16,13 +16,13 @@
  */
 package org.apache.activemq.transport.udp;
 
+import java.io.IOException;
+import java.net.SocketAddress;
+
 import org.apache.activemq.command.Command;
 import org.apache.activemq.openwire.OpenWireFormat;
 import org.apache.activemq.transport.reliable.ReplayBuffer;
 import org.apache.activemq.util.IntSequenceGenerator;
-
-import java.io.IOException;
-import java.net.SocketAddress;
 
 /**
  * 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramChannel.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramChannel.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramChannel.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramChannel.java Wed Aug  8 17:34:07 2007
@@ -55,8 +55,7 @@
     private Object writeLock = new Object();
     private int defaultMarshalBufferSize = 64 * 1024;
 
-    public CommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize,
-                                  SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller,
+    public CommandDatagramChannel(UdpTransport transport, OpenWireFormat wireFormat, int datagramSize, SocketAddress targetAddress, DatagramHeaderMarshaller headerMarshaller,
                                   DatagramChannel channel, ByteBufferPool bufferPool) {
         super(transport, wireFormat, datagramSize, targetAddress, headerMarshaller);
         this.channel = channel;
@@ -224,8 +223,7 @@
 
     // Implementation methods
     // -------------------------------------------------------------------------
-    protected void sendWriteBuffer(int commandId, SocketAddress address, ByteBuffer writeBuffer,
-                                   boolean redelivery) throws IOException {
+    protected void sendWriteBuffer(int commandId, SocketAddress address, ByteBuffer writeBuffer, boolean redelivery) throws IOException {
         // lets put the datagram into the replay buffer first to prevent timing
         // issues
         ReplayBuffer bufferCache = getReplayBuffer();
@@ -236,7 +234,7 @@
         writeBuffer.flip();
 
         if (log.isDebugEnabled()) {
-            String text = (redelivery) ? "REDELIVERING" : "sending";
+            String text = redelivery ? "REDELIVERING" : "sending";
             log.debug("Channel: " + name + " " + text + " datagram: " + commandId + " to: " + address);
         }
         channel.send(writeBuffer, address);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramSocket.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramSocket.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramSocket.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/CommandDatagramSocket.java Wed Aug  8 17:34:07 2007
@@ -202,7 +202,7 @@
         }
 
         if (log.isDebugEnabled()) {
-            String text = (redelivery) ? "REDELIVERING" : "sending";
+            String text = redelivery ? "REDELIVERING" : "sending";
             log.debug("Channel: " + name + " " + text + " datagram: " + commandId + " to: " + address);
         }
         DatagramPacket packet = new DatagramPacket(data, 0, data.length, address);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramEndpoint.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramEndpoint.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramEndpoint.java Wed Aug  8 17:34:07 2007
@@ -16,9 +16,9 @@
  */
 package org.apache.activemq.transport.udp;
 
-import org.apache.activemq.command.BaseEndpoint;
-
 import java.net.SocketAddress;
+
+import org.apache.activemq.command.BaseEndpoint;
 
 /**
  * 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/DatagramHeaderMarshaller.java Wed Aug  8 17:34:07 2007
@@ -17,9 +17,6 @@
 package org.apache.activemq.transport.udp;
 
 
-import org.apache.activemq.command.Command;
-import org.apache.activemq.command.Endpoint;
-
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.net.DatagramPacket;
@@ -27,6 +24,9 @@
 import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.Map;
+
+import org.apache.activemq.command.Command;
+import org.apache.activemq.command.Endpoint;
 
 /**
  * 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/SimpleBufferPool.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/SimpleBufferPool.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/SimpleBufferPool.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/SimpleBufferPool.java Wed Aug  8 17:34:07 2007
@@ -68,8 +68,7 @@
     protected ByteBuffer createBuffer() {
         if (useDirect) {
             return ByteBuffer.allocateDirect(defaultSize);
-        }
-        else {
+        } else {
             return ByteBuffer.allocate(defaultSize);
         }
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransport.java Wed Aug  8 17:34:07 2007
@@ -16,6 +16,19 @@
  */
 package org.apache.activemq.transport.udp;
 
+import java.io.EOFException;
+import java.io.IOException;
+import java.net.BindException;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.net.URI;
+import java.net.UnknownHostException;
+import java.nio.channels.AsynchronousCloseException;
+import java.nio.channels.DatagramChannel;
+
 import org.apache.activemq.Service;
 import org.apache.activemq.command.Command;
 import org.apache.activemq.command.Endpoint;
@@ -30,19 +43,6 @@
 import org.apache.activemq.util.ServiceStopper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.net.BindException;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.net.URI;
-import java.net.UnknownHostException;
-import java.nio.channels.AsynchronousCloseException;
-import java.nio.channels.DatagramChannel;
 
 /**
  * An implementation of the {@link Transport} interface using raw UDP

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java Wed Aug  8 17:34:07 2007
@@ -56,11 +56,9 @@
             Transport configuredTransport = configure(transport, wf, options, true);
             UdpTransportServer server = new UdpTransportServer(location, transport, configuredTransport, createReplayStrategy());
             return server;
-        }
-        catch (URISyntaxException e) {
+        } catch (URISyntaxException e) {
             throw IOExceptionSupport.create(e);
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             throw IOExceptionSupport.create(e);
         }
     }
@@ -71,7 +69,7 @@
 
     public Transport compositeConfigure(Transport transport, WireFormat format, Map options) {
         IntrospectionSupport.setProperties(transport, options);
-        final UdpTransport udpTransport = (UdpTransport) transport;
+        final UdpTransport udpTransport = (UdpTransport)transport;
 
         // deal with fragmentation
         transport = new CommandJoiner(transport, asOpenWireFormat(format));
@@ -97,14 +95,14 @@
     /**
      * Configures the transport
      * 
-     * @param acceptServer
-     *            true if this transport is used purely as an 'accept' transport
-     *            for new connections which work like TCP SocketServers where
-     *            new connections spin up a new separate UDP transport
+     * @param acceptServer true if this transport is used purely as an 'accept'
+     *                transport for new connections which work like TCP
+     *                SocketServers where new connections spin up a new separate
+     *                UDP transport
      */
     protected Transport configure(Transport transport, WireFormat format, Map options, boolean acceptServer) throws Exception {
         IntrospectionSupport.setProperties(transport, options);
-        UdpTransport udpTransport = (UdpTransport) transport;
+        UdpTransport udpTransport = (UdpTransport)transport;
 
         OpenWireFormat openWireFormat = asOpenWireFormat(format);
 
@@ -129,8 +127,7 @@
             // delegate to one that does
             transport = new CommandJoiner(transport, openWireFormat);
             return transport;
-        }
-        else {
+        } else {
             ReliableTransport reliableTransport = new ReliableTransport(transport, udpTransport);
             Replayer replayer = reliableTransport.getReplayer();
             reliableTransport.setReplayStrategy(createReplayStrategy(replayer));
@@ -157,7 +154,7 @@
     }
 
     protected OpenWireFormat asOpenWireFormat(WireFormat wf) {
-        OpenWireFormat answer = (OpenWireFormat) wf;
+        OpenWireFormat answer = (OpenWireFormat)wf;
         return answer;
     }
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportServer.java Wed Aug  8 17:34:07 2007
@@ -54,7 +54,6 @@
     private boolean usingWireFormatNegotiation;
     private Map transports = new HashMap();
 
-
     public UdpTransportServer(URI connectURI, UdpTransport serverTransport, Transport configuredTransport, ReplayStrategy replayStrategy) {
         super(connectURI);
         this.serverTransport = serverTransport;
@@ -81,7 +80,7 @@
 
         configuredTransport.setTransportListener(new TransportListener() {
             public void onCommand(Object o) {
-            	final Command command = (Command) o;
+                final Command command = (Command)o;
                 processInboundConnection(command);
             }
 
@@ -103,18 +102,17 @@
     }
 
     protected void processInboundConnection(Command command) {
-        DatagramEndpoint endpoint = (DatagramEndpoint) command.getFrom();
+        DatagramEndpoint endpoint = (DatagramEndpoint)command.getFrom();
         if (log.isDebugEnabled()) {
             log.debug("Received command on: " + this + " from address: " + endpoint + " command: " + command);
         }
         Transport transport = null;
         synchronized (transports) {
-            transport = (Transport) transports.get(endpoint);
+            transport = (Transport)transports.get(endpoint);
             if (transport == null) {
                 if (usingWireFormatNegotiation && !command.isWireFormatInfo()) {
                     log.error("Received inbound server communication from: " + command.getFrom() + " expecting WireFormatInfo but was command: " + command);
-                }
-                else {
+                } else {
                     if (log.isDebugEnabled()) {
                         log.debug("Creating a new UDP server connection");
                     }
@@ -122,14 +120,12 @@
                         transport = createTransport(command, endpoint);
                         transport = configureTransport(transport);
                         transports.put(endpoint, transport);
-                    }
-                    catch (IOException e) {
+                    } catch (IOException e) {
                         log.error("Caught: " + e, e);
                         getAcceptListener().onAcceptError(e);
                     }
                 }
-            }
-            else {
+            } else {
                 log.warn("Discarding duplicate command to server from: " + endpoint + " command: " + command);
             }
         }
@@ -152,8 +148,9 @@
         final ReliableTransport reliableTransport = new ReliableTransport(transport, transport);
         Replayer replayer = reliableTransport.getReplayer();
         reliableTransport.setReplayStrategy(replayStrategy);
-        
-        // Joiner must be on outside as the inbound messages must be processed by the reliable transport first
+
+        // Joiner must be on outside as the inbound messages must be processed
+        // by the reliable transport first
         return new CommandJoiner(reliableTransport, connectionWireFormat) {
             public void start() throws Exception {
                 super.start();
@@ -161,28 +158,20 @@
             }
         };
 
-
-        
         /**
-        final WireFormatNegotiator wireFormatNegotiator = new WireFormatNegotiator(configuredTransport, transport.getWireFormat(), serverTransport
-                .getMinmumWireFormatVersion()) {
-
-            public void start() throws Exception {
-                super.start();
-                log.debug("Starting a new server transport: " + this + " with command: " + command);
-                onCommand(command);
-            }
-
-            // lets use the specific addressing of wire format
-            protected void sendWireFormat(WireFormatInfo info) throws IOException {
-                log.debug("#### we have negotiated the wireformat; sending a wireformat to: " + address);
-                transport.oneway(info, address);
-            }
-        };
-        return wireFormatNegotiator;
-        */
+         * final WireFormatNegotiator wireFormatNegotiator = new
+         * WireFormatNegotiator(configuredTransport, transport.getWireFormat(),
+         * serverTransport .getMinmumWireFormatVersion()) { public void start()
+         * throws Exception { super.start(); log.debug("Starting a new server
+         * transport: " + this + " with command: " + command);
+         * onCommand(command); } // lets use the specific addressing of wire
+         * format protected void sendWireFormat(WireFormatInfo info) throws
+         * IOException { log.debug("#### we have negotiated the wireformat;
+         * sending a wireformat to: " + address); transport.oneway(info,
+         * address); } }; return wireFormatNegotiator;
+         */
     }
-    
+
     public InetSocketAddress getSocketAddress() {
         return serverTransport.getLocalSocketAddress();
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java Wed Aug  8 17:34:07 2007
@@ -16,10 +16,6 @@
 
 import java.io.IOException;
 import java.net.URI;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.atomic.AtomicLong;
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportFactory.java Wed Aug  8 17:34:07 2007
@@ -21,11 +21,13 @@
 import java.net.URISyntaxException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
 import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.broker.BrokerFactoryHandler;
 import org.apache.activemq.broker.BrokerRegistry;
 import org.apache.activemq.broker.BrokerService;
 import org.apache.activemq.broker.TransportConnector;
-import org.apache.activemq.broker.BrokerFactoryHandler;
 import org.apache.activemq.transport.MarshallingTransportFilter;
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportFactory;
@@ -37,7 +39,6 @@
 import org.apache.activemq.util.URISupport.CompositeData;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import java.util.concurrent.ConcurrentHashMap;
 
 public class VMTransportFactory extends TransportFactory {
     private static final Log log = LogFactory.getLog(VMTransportFactory.class);

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportServer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportServer.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportServer.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransportServer.java Wed Aug  8 17:34:07 2007
@@ -19,6 +19,7 @@
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.URI;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.activemq.command.BrokerInfo;
 import org.apache.activemq.transport.MutexTransport;
@@ -26,8 +27,6 @@
 import org.apache.activemq.transport.Transport;
 import org.apache.activemq.transport.TransportAcceptListener;
 import org.apache.activemq.transport.TransportServer;
-
-import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * Broker side of the VMTransport

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/DataByteArrayInputStream.java Wed Aug  8 17:34:07 2007
@@ -20,7 +20,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.UTFDataFormatException;
-import org.apache.activemq.util.ByteSequence;
 
 /**
  * Optimized ByteArrayInputStream that can be used more than once
@@ -219,8 +218,8 @@
     }
 
     public long readLong() {
-        return (((long)buf[pos++] << 56) + ((long)(buf[pos++] & 255) << 48) + ((long)(buf[pos++] & 255) << 40) + ((long)(buf[pos++] & 255) << 32)
-                + ((long)(buf[pos++] & 255) << 24) + ((buf[pos++] & 255) << 16) + ((buf[pos++] & 255) << 8) + ((buf[pos++] & 255) << 0));
+        long rc = ((long)buf[pos++] << 56) + ((long)(buf[pos++] & 255) << 48) + ((long)(buf[pos++] & 255) << 40) + ((long)(buf[pos++] & 255) << 32);
+        return rc + ((long)(buf[pos++] & 255) << 24) + ((buf[pos++] & 255) << 16) + ((buf[pos++] & 255) << 8) + ((buf[pos++] & 255) << 0);
     }
 
     public float readFloat() throws IOException {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IOHelper.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IOHelper.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IOHelper.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IOHelper.java Wed Aug  8 17:34:07 2007
@@ -30,14 +30,14 @@
     }
 
     /**
-     * Allows a system property to be used to overload the default data directory
-     * which can be useful for forcing the test cases to use a target/ prefix
+     * Allows a system property to be used to overload the default data
+     * directory which can be useful for forcing the test cases to use a target/
+     * prefix
      */
     public static String getDefaultDirectoryPrefix() {
         try {
             return System.getProperty("org.apache.activemq.default.directory.prefix", "");
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             return "";
         }
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/IntrospectionSupport.java Wed Aug  8 17:34:07 2007
@@ -16,8 +16,6 @@
  */
 package org.apache.activemq.util;
 
-import org.apache.activemq.command.ActiveMQDestination;
-
 import java.beans.PropertyEditor;
 import java.beans.PropertyEditorManager;
 import java.lang.reflect.Field;
@@ -30,8 +28,10 @@
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.activemq.command.ActiveMQDestination;
 
 public class IntrospectionSupport {
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MapHelper.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MapHelper.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MapHelper.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MapHelper.java Wed Aug  8 17:34:07 2007
@@ -20,7 +20,7 @@
 
 /**
  * A bunch of utility methods for working with maps
- *
+ * 
  * @version $Revision$
  */
 public class MapHelper {
@@ -33,16 +33,15 @@
     }
 
     /**
-     * Extracts the value from the map and coerces to an int value
-     * or returns a default value if one could not be found or coerced
+     * Extracts the value from the map and coerces to an int value or returns a
+     * default value if one could not be found or coerced
      */
     public static int getInt(Map map, String key, int defaultValue) {
         Object value = map.get(key);
         if (value instanceof Number) {
-            return ((Number) value).intValue();
-        }
-        else if (value instanceof String) {
-            return Integer.parseInt((String) value);
+            return ((Number)value).intValue();
+        } else if (value instanceof String) {
+            return Integer.parseInt((String)value);
         }
         return defaultValue;
     }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MarshallingSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MarshallingSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MarshallingSupport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MarshallingSupport.java Wed Aug  8 17:34:07 2007
@@ -21,8 +21,6 @@
 import java.io.DataOutput;
 import java.io.DataOutputStream;
 import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
 import java.io.UTFDataFormatException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -133,7 +131,7 @@
         } else if (value.getClass() == Double.class) {
             marshalDouble(out, ((Double)value).doubleValue());
         } else if (value.getClass() == byte[].class) {
-            marshalByteArray(out, ((byte[])value));
+            marshalByteArray(out, (byte[])value);
         } else if (value.getClass() == String.class) {
             marshalString(out, (String)value);
         } else if (value instanceof Map) {
@@ -149,9 +147,10 @@
 
     static public Object unmarshalPrimitive(DataInputStream in) throws IOException {
         Object value = null;
-        switch (in.readByte()) {
+        byte type = in.readByte();
+        switch (type) {
         case BYTE_TYPE:
-            value = Byte.valueOf(in.readByte());
+            value = Byte.valueOf(type);
             break;
         case BOOLEAN_TYPE:
             value = in.readBoolean() ? Boolean.TRUE : Boolean.FALSE;
@@ -190,6 +189,8 @@
         case LIST_TYPE:
             value = unmarshalPrimitiveList(in);
             break;
+        default:
+            throw new IOException("Unknown primitive type: " + type);
         }
         return value;
     }
@@ -281,9 +282,9 @@
             // TODO diff: Sun code - removed
             byte[] bytearr = new byte[utflen + 4]; // TODO diff: Sun code
             bytearr[count++] = (byte)((utflen >>> 24) & 0xFF); // TODO diff:
-                                                                // Sun code
+            // Sun code
             bytearr[count++] = (byte)((utflen >>> 16) & 0xFF); // TODO diff:
-                                                                // Sun code
+            // Sun code
             bytearr[count++] = (byte)((utflen >>> 8) & 0xFF);
             bytearr[count++] = (byte)((utflen >>> 0) & 0xFF);
             for (int i = 0; i < strlen; i++) {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MessageComparatorSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MessageComparatorSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MessageComparatorSupport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MessageComparatorSupport.java Wed Aug  8 17:34:07 2007
@@ -16,11 +16,11 @@
  */
 package org.apache.activemq.util;
 
-import javax.jms.Message;
-
 import java.io.Serializable;
 import java.util.Comparator;
 
+import javax.jms.Message;
+
 /**
  * A base class for comparators which works on JMS {@link Message} objects
  * 
@@ -29,8 +29,8 @@
 public abstract class MessageComparatorSupport implements Comparator, Serializable {
 
     public int compare(Object object1, Object object2) {
-        Message command1 = (Message) object1;
-        Message command2 = (Message) object2;
+        Message command1 = (Message)object1;
+        Message command2 = (Message)object2;
         return compareMessages(command1, command2);
     }
 
@@ -39,15 +39,13 @@
     protected int compareComparators(final Comparable comparable, final Comparable comparable2) {
         if (comparable == null && comparable2 == null) {
             return 0;
-        }
-        else if (comparable != null) {
-            if (comparable2== null) {
+        } else if (comparable != null) {
+            if (comparable2 == null) {
                 return 1;
             }
             return comparable.compareTo(comparable2);
-        }
-        else if (comparable2 != null) {
-            if (comparable== null) {
+        } else if (comparable2 != null) {
+            if (comparable == null) {
                 return -11;
             }
             return comparable2.compareTo(comparable) * -1;

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MessageDestinationComparator.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MessageDestinationComparator.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MessageDestinationComparator.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/MessageDestinationComparator.java Wed Aug  8 17:34:07 2007
@@ -16,9 +16,11 @@
  */
 package org.apache.activemq.util;
 
-import org.apache.activemq.command.ActiveMQMessage;
+import javax.jms.Destination;
+import javax.jms.JMSException;
+import javax.jms.Message;
 
-import javax.jms.*;
+import org.apache.activemq.command.ActiveMQMessage;
 
 /**
  * A comparator which works on SendCommand objects to compare the destinations
@@ -33,13 +35,12 @@
 
     protected Destination getDestination(Message message) {
         if (message instanceof ActiveMQMessage) {
-            ActiveMQMessage amqMessage = (ActiveMQMessage) message;
+            ActiveMQMessage amqMessage = (ActiveMQMessage)message;
             return amqMessage.getDestination();
         }
         try {
             return message.getJMSDestination();
-        }
-        catch (JMSException e) {
+        } catch (JMSException e) {
             return null;
         }
     }
@@ -51,6 +52,4 @@
         return null;
     }
 
-
-    
 }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ServiceStopper.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ServiceStopper.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ServiceStopper.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ServiceStopper.java Wed Aug  8 17:34:07 2007
@@ -16,12 +16,12 @@
  */
 package org.apache.activemq.util;
 
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.activemq.Service;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import java.util.Iterator;
-import java.util.List;
 
 /**
  * A helper class used to stop a bunch of services, catching and logging any

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ServiceSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ServiceSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ServiceSupport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/ServiceSupport.java Wed Aug  8 17:34:07 2007
@@ -23,8 +23,9 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
- * A helper class for working with services together with a useful base class for service implementations.
- *  
+ * A helper class for working with services together with a useful base class
+ * for service implementations.
+ * 
  * @version $Revision: 1.1 $
  */
 public abstract class ServiceSupport implements Service {
@@ -37,8 +38,7 @@
     public static void dispose(Service service) {
         try {
             service.stop();
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             log.debug("Could not stop service: " + service + ". Reason: " + e, e);
         }
     }
@@ -55,8 +55,7 @@
             ServiceStopper stopper = new ServiceStopper();
             try {
                 doStop(stopper);
-            }
-            catch (Exception e) {
+            } catch (Exception e) {
                 stopper.onException(this, e);
             }
             stopped.set(true);
@@ -80,7 +79,6 @@
         return stopping.get();
     }
 
-    
     /**
      * @return true if this service is closed
      */

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/URISupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/URISupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/URISupport.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/URISupport.java Wed Aug  8 17:34:07 2007
@@ -227,6 +227,8 @@
                     l.add(s);
                     last = i + 1;
                 }
+                break;
+            default:
             }
         }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/BrokerFactoryBean.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/BrokerFactoryBean.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/BrokerFactoryBean.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/BrokerFactoryBean.java Wed Aug  8 17:34:07 2007
@@ -16,9 +16,14 @@
  */
 package org.apache.activemq.xbean;
 
+import java.beans.PropertyEditorManager;
+import java.net.URI;
+
 import org.apache.activemq.broker.BrokerService;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
+import org.apache.xbean.spring.context.impl.URIEditor;
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.beans.factory.FactoryBean;
@@ -26,11 +31,6 @@
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.core.io.Resource;
-import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
-import org.apache.xbean.spring.context.impl.URIEditor;
-
-import java.beans.PropertyEditorManager;
-import java.net.URI;
 
 /**
  * A Spring {@link FactoryBean} which creates an embedded broker inside a Spring

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/xbean/XBeanBrokerFactory.java Wed Aug  8 17:34:07 2007
@@ -16,12 +16,17 @@
  */
 package org.apache.activemq.xbean;
 
+import java.beans.PropertyEditorManager;
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URI;
+
 import org.apache.activemq.broker.BrokerFactoryHandler;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
-import org.apache.xbean.spring.context.impl.URIEditor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.xbean.spring.context.ResourceXmlApplicationContext;
+import org.apache.xbean.spring.context.impl.URIEditor;
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;
 import org.springframework.core.io.ClassPathResource;
@@ -30,11 +35,6 @@
 import org.springframework.core.io.UrlResource;
 import org.springframework.util.ResourceUtils;
 
-import java.beans.PropertyEditorManager;
-import java.io.File;
-import java.net.URI;
-import java.net.MalformedURLException;
-
 /**
  * @version $Revision$
  */
@@ -52,9 +52,8 @@
 
         BrokerService broker = null;
         try {
-            broker = (BrokerService) context.getBean("broker");
-        }
-        catch (BeansException e) {
+            broker = (BrokerService)context.getBean("broker");
+        } catch (BeansException e) {
         }
 
         if (broker == null) {
@@ -62,7 +61,7 @@
             String[] names = context.getBeanNamesForType(BrokerService.class);
             for (int i = 0; i < names.length; i++) {
                 String name = names[i];
-                broker = (BrokerService) context.getBean(name);
+                broker = (BrokerService)context.getBean(name);
                 if (broker != null) {
                     break;
                 }
@@ -71,24 +70,22 @@
         if (broker == null) {
             throw new IllegalArgumentException("The configuration has no BrokerService instance for resource: " + config);
         }
-        
+
         // TODO warning resources from the context may not be closed down!
-        
+
         return broker;
     }
 
     protected ApplicationContext createApplicationContext(String uri) throws MalformedURLException {
         log.debug("Now attempting to figure out the type of resource: " + uri);
-        
+
         Resource resource;
         File file = new File(uri);
         if (file.exists()) {
             resource = new FileSystemResource(uri);
-        }
-        else if (ResourceUtils.isUrl(uri)) {
+        } else if (ResourceUtils.isUrl(uri)) {
             resource = new UrlResource(uri);
-        }
-        else {
+        } else {
             resource = new ClassPathResource(uri);
         }
         return new ResourceXmlApplicationContext(resource);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQMessageAuditTest.java Wed Aug  8 17:34:07 2007
@@ -62,7 +62,7 @@
         for (int i = 0; i < count; i++) {
             String id = idGen.generateId();
             list.add(id);
-            assertTrue(audit.isDuplicate(id) == false);
+            assertFalse(audit.isDuplicate(id));
         }
         for (String id : list) {
             assertTrue(audit.isDuplicate(id));
@@ -85,7 +85,7 @@
             ActiveMQMessage msg = new ActiveMQMessage();
             msg.setMessageId(id);
             list.add(msg);
-            assertTrue(audit.isDuplicateMessageReference(msg) == false);
+            assertFalse(audit.isDuplicateMessageReference(msg));
         }
         for (MessageReference msg : list) {
             assertTrue(audit.isDuplicateMessageReference(msg));

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/AutoFailTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/AutoFailTestSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/AutoFailTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/AutoFailTestSupport.java Wed Aug  8 17:34:07 2007
@@ -16,9 +16,9 @@
  */
 package org.apache.activemq;
 
-import junit.framework.TestCase;
-
 import java.util.concurrent.atomic.AtomicBoolean;
+
+import junit.framework.TestCase;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/CreateConsumerButDontStartConnectionWarningTest.java Wed Aug  8 17:34:07 2007
@@ -16,11 +16,11 @@
  */
 package org.apache.activemq;
 
+import javax.jms.JMSException;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.jms.JMSException;
-
 /**
  * @version $Revision: 1.1 $
  */
@@ -36,8 +36,7 @@
     protected void assertMessagesAreReceived() throws JMSException {
         try {
             Thread.sleep(1000);
-        }
-        catch (InterruptedException e) {
+        } catch (InterruptedException e) {
             log.warn("Caught: " + e, e);
         }
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/EmbeddedBrokerTestSupport.java Wed Aug  8 17:34:07 2007
@@ -38,9 +38,9 @@
 public abstract class EmbeddedBrokerTestSupport extends TestCase {
 
     protected static final Log LOG = LogFactory.getLog(EmbeddedBrokerTestSupport.class);
-    
+
     protected BrokerService broker;
-    //protected String bindAddress = "tcp://localhost:61616";
+    // protected String bindAddress = "tcp://localhost:61616";
     protected String bindAddress = "vm://localhost";
     protected ConnectionFactory connectionFactory;
     protected boolean useTopic;
@@ -79,8 +79,7 @@
         if (usePooledConnectionWithTemplate) {
             // lets use a pool to avoid creating and closing producers
             return new JmsTemplate(new PooledConnectionFactory(bindAddress));
-        }
-        else {
+        } else {
             return new JmsTemplate(connectionFactory);
         }
     }
@@ -101,8 +100,7 @@
     protected Destination createDestination(String subject) {
         if (useTopic) {
             return new ActiveMQTopic(subject);
-        }
-        else {
+        } else {
             return new ActiveMQQueue(subject);
         }
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsDurableQueueWildcardSendReceiveTest.java Wed Aug  8 17:34:07 2007
@@ -20,14 +20,13 @@
 
 import org.apache.activemq.test.JmsTopicSendReceiveTest;
 
-
 /**
  * @version $Revision: 1.2 $
  */
 public class JmsDurableQueueWildcardSendReceiveTest extends JmsTopicSendReceiveTest {
 
     /**
-     * Set up the test with a queue and persistent delivery mode. 
+     * Set up the test with a queue and persistent delivery mode.
      * 
      * @see junit.framework.TestCase#setUp()
      */
@@ -36,18 +35,18 @@
         deliveryMode = DeliveryMode.PERSISTENT;
         super.setUp();
     }
-    
+
     /**
-     * Returns the consumer subject. 
+     * Returns the consumer subject.
      */
-    protected String getConsumerSubject(){
+    protected String getConsumerSubject() {
         return "FOO.>";
     }
-    
+
     /**
-     * Returns the producer subject. 
+     * Returns the producer subject.
      */
-    protected String getProducerSubject(){
+    protected String getProducerSubject() {
         return "FOO.BAR.HUMBUG";
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueCompositeSendReceiveTest.java Wed Aug  8 17:34:07 2007
@@ -16,12 +16,12 @@
  */
 package org.apache.activemq;
 
-import org.apache.activemq.test.JmsTopicSendReceiveTest;
-
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.MessageConsumer;
 import javax.jms.Topic;
+
+import org.apache.activemq.test.JmsTopicSendReceiveTest;
 
 
 /**

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueSendReceiveMultipleConsumersTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueSendReceiveMultipleConsumersTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueSendReceiveMultipleConsumersTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueSendReceiveMultipleConsumersTest.java Wed Aug  8 17:34:07 2007
@@ -15,24 +15,24 @@
  * limitations under the License.
  */
 package org.apache.activemq;
-import javax.jms.MessageConsumer;
 
+import javax.jms.MessageConsumer;
 
 /**
  * @version $Revision: 1.2 $
  */
-public class JmsQueueSendReceiveMultipleConsumersTest extends JmsQueueSendReceiveTest{
+public class JmsQueueSendReceiveMultipleConsumersTest extends JmsQueueSendReceiveTest {
     MessageConsumer consumer1;
     MessageConsumer consumer2;
-    
+
     protected void setUp() throws Exception {
         messageCount = 5000;
         super.setUp();
-       
+
         consumer1 = createConsumer();
         consumer1.setMessageListener(this);
         consumer2 = createConsumer();
         consumer2.setMessageListener(this);
-        
+
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueTopicCompositeSendReceiveTest.java Wed Aug  8 17:34:07 2007
@@ -16,12 +16,12 @@
  */
 package org.apache.activemq;
 
-import org.apache.activemq.test.JmsTopicSendReceiveTest;
-
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.MessageConsumer;
 import javax.jms.Topic;
+
+import org.apache.activemq.test.JmsTopicSendReceiveTest;
 
 
 /**

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsQueueWildcardSendReceiveTest.java Wed Aug  8 17:34:07 2007
@@ -17,13 +17,13 @@
 package org.apache.activemq;
 
 import javax.jms.DeliveryMode;
-import javax.jms.Session;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.TextMessage;
 import javax.jms.Destination;
 import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.test.JmsTopicSendReceiveTest;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsSendReceiveTestSupport.java Wed Aug  8 17:34:07 2007
@@ -16,6 +16,13 @@
  */
 package org.apache.activemq;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.JMSException;
@@ -25,12 +32,6 @@
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 import javax.jms.TextMessage;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
 
 /**
  * @version $Revision: 1.7 $

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java Wed Aug  8 17:34:07 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.activemq;
 
-import junit.framework.TestCase;
+import java.util.ArrayList;
 
 import javax.jms.BytesMessage;
 import javax.jms.Connection;
@@ -30,7 +30,8 @@
 import javax.jms.Session;
 import javax.jms.TemporaryQueue;
 import javax.jms.TextMessage;
-import java.util.ArrayList;
+
+import junit.framework.TestCase;
 
 /**
  * @version

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTestSupport.java Wed Aug  8 17:34:07 2007
@@ -67,8 +67,9 @@
             return (ActiveMQDestination)session.createTemporaryQueue();
         case ActiveMQDestination.TEMP_TOPIC_TYPE:
             return (ActiveMQDestination)session.createTemporaryTopic();
+        default:
+            throw new IllegalArgumentException("type: " + type);
         }
-        throw new IllegalArgumentException("type: " + type);
     }
 
     protected void sendMessages(Destination destination, int count) throws Exception {

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicCompositeSendReceiveTest.java Wed Aug  8 17:34:07 2007
@@ -16,12 +16,12 @@
  */
 package org.apache.activemq;
 
-import org.apache.activemq.test.JmsTopicSendReceiveTest;
-
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.MessageConsumer;
 import javax.jms.Topic;
+
+import org.apache.activemq.test.JmsTopicSendReceiveTest;
 
 
 /**

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicRequestReplyTest.java Wed Aug  8 17:34:07 2007
@@ -53,29 +53,25 @@
         clientConnection = createConnection();
         clientConnection.setClientID("ClientConnection:" + getSubject());
 
-        Session session = clientConnection.createSession(false,
-                Session.AUTO_ACKNOWLEDGE);
+        Session session = clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
         clientConnection.start();
 
         Destination replyDestination = createTemporaryDestination(session);
 
-
         // lets test the destination
         clientSideClientID = clientConnection.getClientID();
-        
-        //TODO
-       //String value = ActiveMQDestination.getClientId((ActiveMQDestination) replyDestination);
-        //assertEquals("clientID from the temporary destination must be the same", clientSideClientID, value);
-        log.info("Both the clientID and destination clientID match properly: " + clientSideClientID);
 
+        // TODO
+        // String value = ActiveMQDestination.getClientId((ActiveMQDestination)
+        // replyDestination);
+        // assertEquals("clientID from the temporary destination must be the
+        // same", clientSideClientID, value);
+        log.info("Both the clientID and destination clientID match properly: " + clientSideClientID);
 
         /* build queues */
-        MessageProducer requestProducer =
-                session.createProducer(requestDestination);
-        MessageConsumer replyConsumer =
-                session.createConsumer(replyDestination);
-
+        MessageProducer requestProducer = session.createProducer(requestDestination);
+        MessageConsumer replyConsumer = session.createConsumer(replyDestination);
 
         /* build requestmessage */
         TextMessage requestMessage = session.createTextMessage("Olivier");
@@ -87,14 +83,12 @@
 
         Message msg = replyConsumer.receive(5000);
 
-
         if (msg instanceof TextMessage) {
-            TextMessage replyMessage = (TextMessage) msg;
+            TextMessage replyMessage = (TextMessage)msg;
             log.info("Received reply.");
             log.info(replyMessage.toString());
             assertEquals("Wrong message content", "Hello: Olivier", replyMessage.getText());
-        }
-        else {
+        } else {
             fail("Should have received a reply by now");
         }
 
@@ -111,16 +105,19 @@
      */
     public void onMessage(Message message) {
         try {
-            TextMessage requestMessage = (TextMessage) message;
+            TextMessage requestMessage = (TextMessage)message;
 
             log.info("Received request.");
             log.info(requestMessage.toString());
 
             Destination replyDestination = requestMessage.getJMSReplyTo();
 
-            //TODO 
-            //String value = ActiveMQDestination.getClientId((ActiveMQDestination) replyDestination);
-            //assertEquals("clientID from the temporary destination must be the same", clientSideClientID, value);
+            // TODO
+            // String value =
+            // ActiveMQDestination.getClientId((ActiveMQDestination)
+            // replyDestination);
+            // assertEquals("clientID from the temporary destination must be the
+            // same", clientSideClientID, value);
 
             TextMessage replyMessage = serverSession.createTextMessage("Hello: " + requestMessage.getText());
 
@@ -129,15 +126,13 @@
             if (dynamicallyCreateProducer) {
                 replyProducer = serverSession.createProducer(replyDestination);
                 replyProducer.send(replyMessage);
-            }
-            else {
+            } else {
                 replyProducer.send(replyDestination, replyMessage);
             }
 
             log.info("Sent reply.");
             log.info(replyMessage.toString());
-        }
-        catch (JMSException e) {
+        } catch (JMSException e) {
             onException(e);
         }
     }
@@ -150,16 +145,13 @@
             Message message = requestConsumer.receive(5000);
             if (message != null) {
                 onMessage(message);
-            }
-            else {
+            } else {
                 log.error("No message received");
             }
-        }
-        catch (JMSException e) {
+        } catch (JMSException e) {
             onException(e);
         }
     }
-
 
     protected void setUp() throws Exception {
         super.setUp();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveSubscriberTest.java Wed Aug  8 17:34:07 2007
@@ -28,10 +28,9 @@
     protected MessageConsumer createConsumer() throws JMSException {
         if (durable) {
             return super.createConsumer();
-        }
-        else {
+        } else {
             TopicSession topicSession = (TopicSession)session;
-            return topicSession.createSubscriber((Topic) consumerDestination, null, false);
+            return topicSession.createSubscriber((Topic)consumerDestination, null, false);
         }
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicSendReceiveTest.java Wed Aug  8 17:34:07 2007
@@ -27,9 +27,8 @@
  * @version $Revision: 1.3 $
  */
 public class JmsTopicSendReceiveTest extends JmsSendReceiveTestSupport {
-    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
-            .getLog(JmsTopicSendReceiveTest.class);
-    
+    private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(JmsTopicSendReceiveTest.class);
+
     protected Connection connection;
 
     protected void setUp() throws Exception {
@@ -49,14 +48,12 @@
         producer = session.createProducer(null);
         producer.setDeliveryMode(deliveryMode);
 
-        log.info("Created producer: " + producer + " delivery mode = " +
-                (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT"));
+        log.info("Created producer: " + producer + " delivery mode = " + (deliveryMode == DeliveryMode.PERSISTENT ? "PERSISTENT" : "NON_PERSISTENT"));
 
         if (topic) {
             consumerDestination = session.createTopic(getConsumerSubject());
             producerDestination = session.createTopic(getProducerSubject());
-        }
-        else {
+        } else {
             consumerDestination = session.createQueue(getConsumerSubject());
             producerDestination = session.createQueue(getProducerSubject());
         }
@@ -67,20 +64,20 @@
         consumer.setMessageListener(this);
         connection.start();
 
-        //log.info("Created connection: " + connection);
+        // log.info("Created connection: " + connection);
     }
 
     protected MessageConsumer createConsumer() throws JMSException {
         if (durable) {
             log.info("Creating durable consumer");
-            return session.createDurableSubscriber((Topic) consumerDestination, getName());
+            return session.createDurableSubscriber((Topic)consumerDestination, getName());
         }
         return session.createConsumer(consumerDestination);
     }
 
     protected void tearDown() throws Exception {
         log.info("Dumping stats...");
-        //connectionFactory.getStats().reset();
+        // connectionFactory.getStats().reset();
 
         log.info("Closing down connection");
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTopicWildcardSendReceiveTest.java Wed Aug  8 17:34:07 2007
@@ -17,13 +17,13 @@
 package org.apache.activemq;
 
 import javax.jms.DeliveryMode;
-import javax.jms.Session;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.TextMessage;
 import javax.jms.Destination;
 import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
 
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.test.JmsTopicSendReceiveTest;

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/LargeStreamletTest.java Wed Aug  8 17:34:07 2007
@@ -18,20 +18,19 @@
  * limitations under the License.
  */
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Random;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.jms.Destination;
 import javax.jms.Session;
 
 import junit.framework.Assert;
 import junit.framework.TestCase;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * @author rnewson

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/SpringTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/SpringTestSupport.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/SpringTestSupport.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/SpringTestSupport.java Wed Aug  8 17:34:07 2007
@@ -17,15 +17,14 @@
 
 package org.apache.activemq;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.context.support.AbstractApplicationContext;
-
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
 
 import junit.framework.TestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.context.support.AbstractApplicationContext;
 
 /**
  * A useful base class for spring based unit test cases

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java?view=diff&rev=564057&r1=564056&r2=564057
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/TimeStampTest.java Wed Aug  8 17:34:07 2007
@@ -17,12 +17,6 @@
 package org.apache.activemq;
 
 
-import junit.framework.TestCase;
-import org.apache.activemq.broker.BrokerPlugin;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.broker.util.UDPTraceBrokerPlugin;
-import org.apache.activemq.broker.view.ConnectionDotFilePlugin;
-
 import javax.jms.Connection;
 import javax.jms.DeliveryMode;
 import javax.jms.Destination;
@@ -31,6 +25,12 @@
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 
+import junit.framework.TestCase;
+import org.apache.activemq.broker.BrokerPlugin;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.util.UDPTraceBrokerPlugin;
+import org.apache.activemq.broker.view.ConnectionDotFilePlugin;
+
 public class TimeStampTest extends TestCase {
     public void test() throws Exception {
         BrokerService broker = new BrokerService();
@@ -79,10 +79,10 @@
         assertEquals(sentMessage.getJMSMessageID(), receivedMessage.getJMSMessageID());
 
         // assert message timestamp is in window
-        assertTrue("JMS Message Timestamp should be set during the send method: \n" +
-                "        beforeSend = " + beforeSend + "\n" +
-                "   getJMSTimestamp = " + receivedMessage.getJMSTimestamp() + "\n" +
-                "         afterSend = " + afterSend + "\n",
+        assertTrue("JMS Message Timestamp should be set during the send method: \n" 
+                + "        beforeSend = " + beforeSend + "\n"
+                + "   getJMSTimestamp = " + receivedMessage.getJMSTimestamp() + "\n"
+                + "         afterSend = " + afterSend + "\n",
                 beforeSend <= receivedMessage.getJMSTimestamp() && receivedMessage.getJMSTimestamp() <= afterSend);
 
         // assert message timestamp is unchanged