qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grk...@apache.org
Subject svn commit: r1071700 - /qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java
Date Thu, 17 Feb 2011 17:07:37 GMT
Author: grkvlt
Date: Thu Feb 17 17:07:37 2011
New Revision: 1071700

URL: http://svn.apache.org/viewvc?rev=1071700&view=rev
Log:
QPID-3065: Tidy up unused parts of Disassembler

Modified:
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java?rev=1071700&r1=1071699&r2=1071700&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java
(original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java
Thu Feb 17 17:07:37 2011
@@ -40,19 +40,13 @@ import static java.lang.Math.min;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 
-
 /**
  * Disassembler
- *
  */
-
-public final class Disassembler implements Sender<ProtocolEvent>,
-                                           ProtocolDelegate<Void>
+public final class Disassembler implements Sender<ProtocolEvent>, ProtocolDelegate<Void>
 {
-
     private final Sender<ByteBuffer> sender;
     private final int maxPayload;
-    private final ByteBuffer header;
     private final Object sendlock = new Object();
     private final static ThreadLocal<BBEncoder> _encoder = new ThreadLocal<BBEncoder>()
     {
@@ -66,14 +60,10 @@ public final class Disassembler implemen
     {
         if (maxFrame <= HEADER_SIZE || maxFrame >= 64*1024)
         {
-            throw new IllegalArgumentException
-                ("maxFrame must be > HEADER_SIZE and < 64K: " + maxFrame);
+            throw new IllegalArgumentException("maxFrame must be > HEADER_SIZE and <
64K: " + maxFrame);
         }
         this.sender = sender;
         this.maxPayload  = maxFrame - HEADER_SIZE;
-        this.header =  ByteBuffer.allocate(HEADER_SIZE);
-        this.header.order(ByteOrder.BIG_ENDIAN);
-
     }
 
     public void send(ProtocolEvent event)
@@ -121,8 +111,7 @@ public final class Disassembler implemen
         }
     }
 
-    private void fragment(byte flags, SegmentType type, ProtocolEvent event,
-                          ByteBuffer buf)
+    private void fragment(byte flags, SegmentType type, ProtocolEvent event, ByteBuffer buf)
     {
         byte typeb = (byte) type.getValue();
         byte track = event.getEncodedTrack() == Frame.L4 ? (byte) 1 : (byte) 0;
@@ -173,14 +162,6 @@ public final class Disassembler implemen
         method(method, SegmentType.COMMAND);
     }
 
-    private ByteBuffer copy(ByteBuffer src)
-    {
-        ByteBuffer buf = ByteBuffer.allocate(src.remaining());
-        buf.put(src);
-        buf.flip();
-        return buf;
-    }
-
     private void method(Method method, SegmentType type)
     {
         BBEncoder enc = _encoder.get();
@@ -230,8 +211,7 @@ public final class Disassembler implemen
             if (payload)
             {
                 ByteBuffer body = method.getBody();
-                fragment(body == null ? LAST_SEG : 0x0, SegmentType.HEADER,
-                         method, headerSeg);
+                fragment(body == null ? LAST_SEG : 0x0, SegmentType.HEADER, method, headerSeg);
                 if (body != null)
                 {
                     fragment(LAST_SEG, SegmentType.BODY, method, body);
@@ -243,7 +223,7 @@ public final class Disassembler implemen
 
     public void error(Void v, ProtocolError error)
     {
-        throw new IllegalArgumentException("" + error);
+        throw new IllegalArgumentException(String.valueOf(error));
     }
 
     public void setIdleTimeout(int i)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message