You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by dd...@apache.org on 2008/03/13 11:01:22 UTC

svn commit: r636692 - in /hadoop/core/trunk: CHANGES.txt src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java

Author: ddas
Date: Thu Mar 13 03:01:13 2008
New Revision: 636692

URL: http://svn.apache.org/viewvc?rev=636692&view=rev
Log:
HADOOP-2996. Fixes uses of StringBuffer in StreamUtils class. Contributed by Dave Brosius.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=636692&r1=636691&r2=636692&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Thu Mar 13 03:01:13 2008
@@ -187,6 +187,9 @@
     HADOOP-2974. IPC unit tests used "0.0.0.0" to connect to server, which
     is not always supported. (rangadi)
 
+    HADOOP-2996. Fixes uses of StringBuffer in StreamUtils class.
+    (Dave Brosius via ddas)
+
 Release 0.16.1 - 2008-03-13
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java?rev=636692&r1=636691&r2=636692&view=diff
==============================================================================
--- hadoop/core/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java (original)
+++ hadoop/core/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java Thu Mar 13 03:01:13 2008
@@ -156,21 +156,21 @@
     double num = numBytes;
 
     if (numBytes < KB) {
-      buf.append(numBytes + " B");
+      buf.append(numBytes).append(" B");
       bDetails = false;
     } else if (numBytes < MB) {
-      buf.append(dfmt(num / KB) + " KB");
+      buf.append(dfmt(num / KB)).append(" KB");
     } else if (numBytes < GB) {
-      buf.append(dfmt(num / MB) + " MB");
+      buf.append(dfmt(num / MB)).append(" MB");
     } else if (numBytes < TB) {
-      buf.append(dfmt(num / GB) + " GB");
+      buf.append(dfmt(num / GB)).append(" GB");
     } else if (numBytes < PB) {
-      buf.append(dfmt(num / TB) + " TB");
+      buf.append(dfmt(num / TB)).append(" TB");
     } else {
-      buf.append(dfmt(num / PB) + " PB");
+      buf.append(dfmt(num / PB)).append(" PB");
     }
     if (bDetails) {
-      buf.append(" (" + ifmt(numBytes) + " bytes)");
+      buf.append(" (").append(ifmt(numBytes)).append(" bytes)");
     }
     return buf.toString();
   }
@@ -181,24 +181,24 @@
     if (numBytes >= TB) {
       u = numBytes / TB;
       numBytes -= u * TB;
-      buf.append(u + " TB ");
+      buf.append(u).append(" TB ");
     }
     if (numBytes >= GB) {
       u = numBytes / GB;
       numBytes -= u * GB;
-      buf.append(u + " GB ");
+      buf.append(u).append(" GB ");
     }
     if (numBytes >= MB) {
       u = numBytes / MB;
       numBytes -= u * MB;
-      buf.append(u + " MB ");
+      buf.append(u).append(" MB ");
     }
     if (numBytes >= KB) {
       u = numBytes / KB;
       numBytes -= u * KB;
-      buf.append(u + " KB ");
+      buf.append(u).append(" KB ");
     }
-    buf.append(u + " B"); //even if zero
+    buf.append(u).append(" B"); //even if zero
     return buf.toString();
   }