cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r758972 - /incubator/cassandra/trunk/src/org/apache/cassandra/net/Message.java
Date Fri, 27 Mar 2009 02:19:06 GMT
Author: jbellis
Date: Fri Mar 27 02:19:06 2009
New Revision: 758972

URL: http://svn.apache.org/viewvc?rev=758972&view=rev
Log:
change Object[] to Object... so passing a single one is easier

Modified:
    incubator/cassandra/trunk/src/org/apache/cassandra/net/Message.java

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/net/Message.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/net/Message.java?rev=758972&r1=758971&r2=758972&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/net/Message.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/net/Message.java Fri Mar 27 02:19:06
2009
@@ -53,27 +53,20 @@
     Header header_;
     private Object[] body_ = new Object[0];
     
-    /* Ctor for JAXB. DO NOT DELETE */
-    private Message()
+    protected Message(String id, EndPoint from, String messageType, String verb, Object...
body)
     {
-    }
-
-    protected Message(String id, EndPoint from, String messageType, String verb, Object[]
body)
-    {
-        header_ = new Header(id, from, messageType, verb);
-        body_ = body;
+        this(new Header(id, from, messageType, verb), body);
     }
     
-    protected Message(Header header, Object[] body)
+    protected Message(Header header, Object... body)
     {
         header_ = header;
         body_ = body;
     }
 
-    public Message(EndPoint from, String messageType, String verb, Object[] body)
+    public Message(EndPoint from, String messageType, String verb, Object... body)
     {
-        header_ = new Header(from, messageType, verb);
-        body_ = body;
+        this(new Header(from, messageType, verb), body);
     }    
     
     public byte[] getHeader(Object key)
@@ -164,7 +157,7 @@
         header_.setMessageId(id);
     }    
 
-    public Message getReply(EndPoint from, Object[] args)
+    public Message getReply(EndPoint from, Object... args)
     {        
         Message response = new Message(getMessageId(),
                                        from,



Mime
View raw message