harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r778555 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/lang/AbstractStringBuilder.java test/api/common/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java
Date Tue, 26 May 2009 03:11:37 GMT
Author: ndbeyer
Date: Tue May 26 03:11:37 2009
New Revision: 778555

URL: http://svn.apache.org/viewvc?rev=778555&view=rev
Log:
Apply patches for HARMONY-6212 - [classlib][luni] StringBuilder behavior affects the string
got by the toString

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/AbstractStringBuilder.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.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=778555&r1=778554&r2=778555&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
Tue May 26 03:11:37 2009
@@ -205,7 +205,7 @@
             }
             if (end > start) {
                 int length = count - end;
-                if (length > 0) {
+                if (length >= 0) {
                     if (!shared) {
                         System.arraycopy(value, end, value, start, length);
                     } else {

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java?rev=778555&r1=778554&r2=778555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/java/lang/StringBuilderTest.java
Tue May 26 03:11:37 2009
@@ -572,6 +572,15 @@
 		} catch (StringIndexOutOfBoundsException e) {
 			// Expected
 		}
+
+                // HARMONY 6212
+                sb = new StringBuilder();
+                sb.append("abcde");
+                String str = sb.toString();
+                sb.delete(0, sb.length());
+                sb.append("YY");
+                assertEquals("abcde", str);
+                assertEquals("YY", sb.toString());
 	}
 
 	/**



Mime
View raw message