hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From he...@apache.org
Subject svn commit: r902690 - in /hadoop/zookeeper/trunk: ./ src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/ src/java/main/org/apache/jute/ src/java/main/org/apache/jute/compiler/ src/java/main/org/apache/zookeeper/ src/java/main/org/apache/z...
Date Mon, 25 Jan 2010 03:28:41 GMT
Author: henry
Date: Mon Jan 25 03:28:40 2010
New Revision: 902690

URL: http://svn.apache.org/viewvc?rev=902690&view=rev
Log:
ZOOKEEPER-655. StringBuffer -> StringBuilder - conversion of references as necessary (Kay
Kay via henry)

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/MySqlClient.java
    hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/TestClient.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/jute/CsvInputArchive.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/jute/Utils.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/jute/XmlOutputArchive.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JMap.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JVector.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ZooKeeperMain.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/common/PathTrie.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/Request.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/auth/DigestAuthenticationProvider.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LeaderBean.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Observer.java
    hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java
    hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Mon Jan 25 03:28:40 2010
@@ -247,6 +247,8 @@
 
   ZOOKEEPER-626. ensure the c/java cli's print xid/sessionid/etc... in hex (pat via mahadev)
 
+  ZOOKEEPER-655. StringBuffer -> StringBuilder - conversion of references as necessary
(Kay Kay via henry)
+
 NEW FEATURES:
   ZOOKEEPER-539. generate eclipse project via ant target. (phunt via mahadev)
 

Modified: hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/MySqlClient.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/MySqlClient.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/MySqlClient.java
(original)
+++ hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/MySqlClient.java
Mon Jan 25 03:28:40 2010
@@ -84,7 +84,7 @@
 	 */
 	public static void main(String[] args) throws ClassNotFoundException, SQLException {		
 		int lenght = Integer.parseInt(args[1]);
-		StringBuffer sb = new StringBuffer();
+		StringBuilder sb = new StringBuilder();
 		while(lenght-- > 0){
 			sb.append('a');
 		}

Modified: hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/TestClient.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/TestClient.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/TestClient.java
(original)
+++ hadoop/zookeeper/trunk/src/contrib/bookkeeper/benchmark/org/apache/bookkeeper/benchmark/TestClient.java
Mon Jan 25 03:28:40 2010
@@ -127,7 +127,7 @@
     public static void main(String[] args) {
         
         int lenght = Integer.parseInt(args[1]);
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         while(lenght-- > 0){
             sb.append('a');
         }
@@ -135,7 +135,7 @@
         Integer selection = Integer.parseInt(args[0]);
         switch(selection){
         case 0:           
-            StringBuffer servers_sb = new StringBuffer();
+            StringBuilder servers_sb = new StringBuilder();
             for (int i = 4; i < args.length; i++){
                 servers_sb.append(args[i] + " ");
             }

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/jute/CsvInputArchive.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/jute/CsvInputArchive.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/jute/CsvInputArchive.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/jute/CsvInputArchive.java Mon Jan 25 03:28:40
2010
@@ -50,7 +50,7 @@
     
     private String readField(String tag) throws IOException {
         try {
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
             while (true) {
                 char c = (char) stream.read();
                 switch (c) {

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/jute/Utils.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/jute/Utils.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/jute/Utils.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/jute/Utils.java Mon Jan 25 03:28:40 2010
@@ -64,7 +64,7 @@
         if (s == null)
             return "";
 
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int idx = 0; idx < s.length(); idx++) {
           char ch = s.charAt(idx);
           if (ch == '<') {
@@ -101,7 +101,7 @@
      * @return 
      */
     static String fromXMLString(String s) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int idx = 0; idx < s.length();) {
           char ch = s.charAt(idx++);
           if (ch == '%') {
@@ -126,7 +126,7 @@
         if (s == null)
             return "";
 
-        StringBuffer sb = new StringBuffer(s.length()+1);
+        StringBuilder sb = new StringBuilder(s.length()+1);
         sb.append('\'');
         int len = s.length();
         for (int i = 0; i < len; i++) {
@@ -168,7 +168,7 @@
             throw new IOException("Error deserializing string.");
         }
         int len = s.length();
-        StringBuffer sb = new StringBuffer(len-1);
+        StringBuilder sb = new StringBuilder(len-1);
         for (int i = 1; i < len; i++) {
             char c = s.charAt(i);
             if (c == '%') {
@@ -198,7 +198,7 @@
         if (barr == null || barr.length == 0) {
             return "";
         }
-        StringBuffer sb = new StringBuffer(2*barr.length);
+        StringBuilder sb = new StringBuilder(2*barr.length);
         for (int idx = 0; idx < barr.length; idx++) {
             sb.append(Integer.toHexString(barr[idx]));
         }
@@ -235,7 +235,7 @@
         if (barr == null || barr.length == 0) {
             return "";
         }
-        StringBuffer sb = new StringBuffer(barr.length + 1);
+        StringBuilder sb = new StringBuilder(barr.length + 1);
         sb.append('#');
         for(int idx = 0; idx < barr.length; idx++) {
             sb.append(Integer.toHexString(barr[idx]));

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/jute/XmlOutputArchive.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/jute/XmlOutputArchive.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/jute/XmlOutputArchive.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/jute/XmlOutputArchive.java Mon Jan 25
03:28:40 2010
@@ -37,7 +37,7 @@
     private Stack<String> compoundStack;
     
     private void putIndent() {
-        StringBuffer sb = new StringBuffer("");
+        StringBuilder sb = new StringBuilder("");
         for (int idx = 0; idx < indent; idx++) {
             sb.append("  ");
         }

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JBuffer.java Mon Jan 25
03:28:40 2010
@@ -55,7 +55,7 @@
     }
     
     public String genJavaCompareTo(String fname, String other) {
-      StringBuffer sb = new StringBuffer();
+      StringBuilder sb = new StringBuilder();
       sb.append("    {\n");
       sb.append("      byte[] my = "+fname+";\n");
       sb.append("      byte[] ur = "+other+";\n");
@@ -80,7 +80,7 @@
     }
     
     public String genJavaSlurpBytes(String b, String s, String l) {
-      StringBuffer sb = new StringBuffer();
+      StringBuilder sb = new StringBuilder();
       sb.append("        {\n");
       sb.append("           int i = org.apache.jute.Utils.readVInt("+b+", "+s+");\n");
       sb.append("           int z = WritableUtils.getVIntSize(i);\n");
@@ -90,7 +90,7 @@
     }
     
     public String genJavaCompareBytes() {
-      StringBuffer sb = new StringBuffer();
+      StringBuilder sb = new StringBuilder();
       sb.append("        {\n");
       sb.append("           int i1 = org.apache.jute.Utils.readVInt(b1, s1);\n");
       sb.append("           int i2 = org.apache.jute.Utils.readVInt(b2, s2);\n");

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JMap.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JMap.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JMap.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JMap.java Mon Jan 25 03:28:40
2010
@@ -56,7 +56,7 @@
     }
     
     public String genJavaReadWrapper(String fname, String tag, boolean decl) {
-        StringBuffer ret = new StringBuffer("");
+        StringBuilder ret = new StringBuilder("");
         if (decl) {
             ret.append("    java.util.TreeMap "+fname+";\n");
         }
@@ -80,7 +80,7 @@
     }
     
     public String genJavaWriteWrapper(String fname, String tag) {
-        StringBuffer ret = new StringBuffer("    {\n");
+        StringBuilder ret = new StringBuilder("    {\n");
         incrLevel();
         ret.append("      a_.startMap("+fname+",\""+tag+"\");\n");
         ret.append("      java.util.Set "+getId("es")+" = "+fname+".entrySet();\n");

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JRecord.java Mon Jan 25
03:28:40 2010
@@ -73,7 +73,7 @@
     }
 
     public String getSignature() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("L").append(mName).append("(");
         for (Iterator<JField> i = mFields.iterator(); i.hasNext();) {
             String s = i.next().getSignature();
@@ -92,7 +92,7 @@
     }
 
     public String genJavaReadWrapper(String fname, String tag, boolean decl) {
-        StringBuffer ret = new StringBuffer("");
+        StringBuilder ret = new StringBuilder("");
         if (decl) {
             ret.append("    "+getJavaFQName()+" "+fname+";\n");
         }

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JVector.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JVector.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JVector.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/jute/compiler/JVector.java Mon Jan 25
03:28:40 2010
@@ -51,7 +51,7 @@
     }
     
     public String genJavaReadWrapper(String fname, String tag, boolean decl) {
-        StringBuffer ret = new StringBuffer("");
+        StringBuilder ret = new StringBuilder("");
         if (decl) {
             ret.append("      java.util.List "+fname+";\n");
         }
@@ -76,7 +76,7 @@
     }
     
     public String genJavaWriteWrapper(String fname, String tag) {
-        StringBuffer ret = new StringBuffer("    {\n");
+        StringBuilder ret = new StringBuilder("    {\n");
         incrLevel();
         ret.append("      a_.startVector("+fname+",\""+tag+"\");\n");
         ret.append("      if ("+fname+"!= null) {");

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ClientCnxn.java Mon Jan 25 03:28:40
2010
@@ -167,7 +167,7 @@
 
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         SocketAddress local = getLocalSocketAddress();
         SocketAddress remote = getRemoteSocketAddress();
@@ -279,7 +279,7 @@
 
         @Override
         public String toString() {
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
 
             sb.append("clientPath:" + clientPath);
             sb.append(" serverPath:" + serverPath);

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ZooKeeperMain.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ZooKeeperMain.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ZooKeeperMain.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/ZooKeeperMain.java Mon Jan 25
03:28:40 2010
@@ -535,7 +535,7 @@
         // now create the direct children
         // and the stat and quota nodes
         String[] splits = path.split("/");
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(quotaPath);
         for (int i=1; i<splits.length; i++) {
             sb.append("/" + splits[i]);
@@ -791,7 +791,7 @@
     }
 
     private static String getPermString(int perms) {
-        StringBuffer p = new StringBuffer();
+        StringBuilder p = new StringBuilder();
         if ((perms & ZooDefs.Perms.CREATE) != 0) {
             p.append('c');
         }

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/common/PathTrie.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/common/PathTrie.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/common/PathTrie.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/common/PathTrie.java Mon Jan
25 03:28:40 2010
@@ -169,7 +169,7 @@
          * for this node
          */
         public String toString() {
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             sb.append("Children of trienode: ");
             synchronized(children) {
                 for (String str: children.keySet()) {
@@ -259,7 +259,7 @@
         }
         int i = 1;
         String part = null;
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         int lastindex = -1;
         while((i < pathComponents.length)) {
             if (parent.getChild(pathComponents[i]) != null) {

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/DataTree.java Mon Jan
25 03:28:40 2010
@@ -1076,7 +1076,7 @@
 
     public String dumpEphemerals() {
         Set<Long> keys = ephemerals.keySet();
-        StringBuffer sb = new StringBuffer("Sessions with Ephemerals ("
+        StringBuilder sb = new StringBuilder("Sessions with Ephemerals ("
                 + keys.size() + "):\n");
         for (long k : keys) {
             sb.append("0x" + Long.toHexString(k));

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/FinalRequestProcessor.java
Mon Jan 25 03:28:40 2010
@@ -333,7 +333,7 @@
             // log at error level as we are returning a marshalling
             // error to the user
             LOG.error("Failed to process " + request, e);
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             ByteBuffer bb = request.request;
             bb.rewind();
             while (bb.hasRemaining()) {

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/NIOServerCnxn.java Mon
Jan 25 03:28:40 2010
@@ -796,7 +796,7 @@
                 sendBuffer(ByteBuffer.wrap("ZooKeeper not active \n"
                         .getBytes()));
             } else {
-                StringBuffer sb = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 sb.append("SessionTracker dump: \n");
                 sb.append(zk.sessionTracker.toString()).append("\n");
                 sb.append("ephemeral nodes dump:\n");
@@ -811,7 +811,7 @@
                     + sock.socket().getRemoteSocketAddress());
             packetReceived();
 
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             if (zk != null){
                 sb.append("Zookeeper version: ").append(Version.getFullVersion())
                     .append("\n");
@@ -839,7 +839,7 @@
                     + sock.socket().getRemoteSocketAddress());
             packetReceived();
 
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             if (zk != null){
                 synchronized(factory.cnxns){
                     for(NIOServerCnxn c : factory.cnxns){
@@ -859,7 +859,7 @@
                     + sock.socket().getRemoteSocketAddress());
             packetReceived();
 
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
 
             List<Environment.Entry> env = Environment.list();
 

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java
Mon Jan 25 03:28:40 2010
@@ -412,7 +412,7 @@
             // error to the user
             LOG.error("Failed to process " + request, e);
 
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             ByteBuffer bb = request.request;
             if(bb != null){
                 bb.rewind();

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/Request.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/Request.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/Request.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/Request.java Mon Jan
25 03:28:40 2010
@@ -182,7 +182,7 @@
 
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("sessionid:0x").append(Long.toHexString(sessionId))
             .append(" type:").append(op2String(type))
             .append(" cxid:0x").append(Long.toHexString(cxid))

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/SessionTrackerImpl.java
Mon Jan 25 03:28:40 2010
@@ -105,7 +105,7 @@
 
     @Override
     synchronized public String toString() {
-        StringBuffer sb = new StringBuffer("Session Sets (")
+        StringBuilder sb = new StringBuilder("Session Sets (")
                 .append(sessionSets.size()).append("):\n");
         ArrayList<Long> keys = new ArrayList<Long>(sessionSets.keySet());
         Collections.sort(keys);

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/auth/DigestAuthenticationProvider.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/auth/DigestAuthenticationProvider.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/auth/DigestAuthenticationProvider.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/auth/DigestAuthenticationProvider.java
Mon Jan 25 03:28:40 2010
@@ -43,7 +43,7 @@
     }
 
     static final private String base64Encode(byte b[]) {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (int i = 0; i < b.length;) {
             int pad = 0;
             int v = (b[i++] & 0xff) << 16;

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Follower.java
Mon Jan 25 03:28:40 2010
@@ -44,7 +44,7 @@
 
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("Follower ").append(sock);
         sb.append(" lastQueuedZxid:").append(lastQueued);
         sb.append(" pendingRevalidationCount:")

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java (original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Leader.java Mon
Jan 25 03:28:40 2010
@@ -20,7 +20,6 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.lang.StringBuffer;
 import java.net.BindException;
 import java.net.ServerSocket;
 import java.net.Socket;
@@ -309,7 +308,7 @@
                 if (self.tick > self.initLimit) {
                     // Followers aren't syncing fast enough,
                     // renounce leadership!
-                    StringBuffer ackToString = new StringBuffer();
+                    StringBuilder ackToString = new StringBuilder();
                     for(Long id : newLeaderProposal.ackSet)
                         ackToString.append(id + ": ");
                     

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LeaderBean.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LeaderBean.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LeaderBean.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LeaderBean.java
Mon Jan 25 03:28:40 2010
@@ -43,7 +43,7 @@
     }
     
     public String followerInfo() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         for (LearnerHandler handler : leader.learners) {
             sb.append(handler.toString()).append("\n");
         }

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/LearnerHandler.java
Mon Jan 25 03:28:40 2010
@@ -91,7 +91,7 @@
     
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("LearnerHandler ").append(sock);
         sb.append(" tickOfLastAck:").append(tickOfLastAck());
         sb.append(" synced?:").append(synced());

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Observer.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Observer.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Observer.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/quorum/Observer.java
Mon Jan 25 03:28:40 2010
@@ -47,7 +47,7 @@
 
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("Observer ").append(sock);        
         sb.append(" pendingRevalidationCount:")
             .append(pendingRevalidations.size());

Modified: hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java
(original)
+++ hadoop/zookeeper/trunk/src/java/main/org/apache/zookeeper/server/upgrade/DataTreeV1.java
Mon Jan 25 03:28:40 2010
@@ -553,7 +553,7 @@
 
     public String dumpEphemerals() {
         Set<Long> keys = ephemerals.keySet();
-        StringBuffer sb = new StringBuffer("Sessions with Ephemerals ("
+        StringBuilder sb = new StringBuilder("Sessions with Ephemerals ("
                 + keys.size() + "):\n");
         for (long k : keys) {
             sb.append("0x" + Long.toHexString(k));

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/AsyncOps.java Mon Jan 25
03:28:40 2010
@@ -220,7 +220,7 @@
         }
         
         public String toString(List<ACL> acls) {
-            StringBuffer result = new StringBuffer();
+            StringBuilder result = new StringBuilder();
             for(ACL acl : acls) {
                 result.append(acl.getPerms() + "::");
             }

Modified: hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java?rev=902690&r1=902689&r2=902690&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java (original)
+++ hadoop/zookeeper/trunk/src/java/test/org/apache/zookeeper/test/ClientBase.java Mon Jan
25 03:28:40 2010
@@ -200,7 +200,7 @@
             reader =
                 new BufferedReader(
                         new InputStreamReader(sock.getInputStream()));
-            StringBuffer sb = new StringBuffer();
+            StringBuilder sb = new StringBuilder();
             String line;
             while((line = reader.readLine()) != null) {
                 sb.append(line + "\n");
@@ -456,7 +456,7 @@
     }
 
     private static void logAllStackTraces() {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append("Starting logAllStackTraces()\n");
         Map<Thread, StackTraceElement[]> threads = Thread.getAllStackTraces();
         for (Entry<Thread, StackTraceElement[]> e: threads.entrySet()) {



Mime
View raw message