harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r792396 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
Date Thu, 09 Jul 2009 04:34:53 GMT
Author: regisxu
Date: Thu Jul  9 04:34:53 2009
New Revision: 792396

URL: http://svn.apache.org/viewvc?rev=792396&view=rev
Log:
add parentheses to make sure calculating "newSize" correctly

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java?rev=792396&r1=792395&r2=792396&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
Thu Jul  9 04:34:53 2009
@@ -91,7 +91,7 @@
     }
 
     private void enlargeBuffer(int min) {
-        int newSize = (value.length >> 1 + value.length) + 2;
+        int newSize = ((value.length >> 1) + value.length) + 2;
         char[] newData = new char[min > newSize ? min : newSize];
         System.arraycopy(value, 0, newData, 0, count);
         value = newData;



Mime
View raw message