You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2006/04/14 11:59:00 UTC

[jira] Created: (HARMONY-348) java.lang.StringBuilder.replace does not get right result

java.lang.StringBuilder.replace does not get right result
---------------------------------------------------------

         Key: HARMONY-348
         URL: http://issues.apache.org/jira/browse/HARMONY-348
     Project: Harmony
        Type: Bug

  Components: Classlib  
    Reporter: Paulex Yang


java.lang.StringBuilder.replace(start,end, str) should replace the substring starting at param start and ending at param end -1 with the str parameter, but the Harmony's implementation's behavior is not compliant with spec and RI.  The following test case reproduce the bug:
 
public void test_replace()
	{
		StringBuilder buffer = new StringBuilder("1234567");
		buffer.replace(2, 6, "XXX");
		assertEquals("12XXX7",buffer.toString());
		
	}

RI(Sun JDK 1.5.0_06)   passed
Harmony failed


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (HARMONY-348) java.lang.StringBuilder.replace does not get right result

Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-348?page=comments#action_12383190 ] 

Paulex Yang commented on HARMONY-348:
-------------------------------------

the fix looks fine. Thank you, Sergey and Tim.

> java.lang.StringBuilder.replace does not get right result
> ---------------------------------------------------------
>
>          Key: HARMONY-348
>          URL: http://issues.apache.org/jira/browse/HARMONY-348
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: harmony-348.diff
>
> java.lang.StringBuilder.replace(start,end, str) should replace the substring starting at param start and ending at param end -1 with the str parameter, but the Harmony's implementation's behavior is not compliant with spec and RI.  The following test case reproduce the bug:
>  
> public void test_replace()
> 	{
> 		StringBuilder buffer = new StringBuilder("1234567");
> 		buffer.replace(2, 6, "XXX");
> 		assertEquals("12XXX7",buffer.toString());
> 		
> 	}
> RI(Sun JDK 1.5.0_06)   passed
> Harmony failed

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (HARMONY-348) java.lang.StringBuilder.replace does not get right result

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-348?page=all ]

Tim Ellison reassigned HARMONY-348:
-----------------------------------

    Assign To: Tim Ellison

> java.lang.StringBuilder.replace does not get right result
> ---------------------------------------------------------
>
>          Key: HARMONY-348
>          URL: http://issues.apache.org/jira/browse/HARMONY-348
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: harmony-348.diff
>
> java.lang.StringBuilder.replace(start,end, str) should replace the substring starting at param start and ending at param end -1 with the str parameter, but the Harmony's implementation's behavior is not compliant with spec and RI.  The following test case reproduce the bug:
>  
> public void test_replace()
> 	{
> 		StringBuilder buffer = new StringBuilder("1234567");
> 		buffer.replace(2, 6, "XXX");
> 		assertEquals("12XXX7",buffer.toString());
> 		
> 	}
> RI(Sun JDK 1.5.0_06)   passed
> Harmony failed

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (HARMONY-348) java.lang.StringBuilder.replace does not get right result

Posted by "Sergey Soldatov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-348?page=all ]

Sergey Soldatov updated HARMONY-348:
------------------------------------

    Attachment: harmony-348.diff

This patch should fix the problem. Handler for case when the substring  is longer than the specified string has been added.

> java.lang.StringBuilder.replace does not get right result
> ---------------------------------------------------------
>
>          Key: HARMONY-348
>          URL: http://issues.apache.org/jira/browse/HARMONY-348
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>  Attachments: harmony-348.diff
>
> java.lang.StringBuilder.replace(start,end, str) should replace the substring starting at param start and ending at param end -1 with the str parameter, but the Harmony's implementation's behavior is not compliant with spec and RI.  The following test case reproduce the bug:
>  
> public void test_replace()
> 	{
> 		StringBuilder buffer = new StringBuilder("1234567");
> 		buffer.replace(2, 6, "XXX");
> 		assertEquals("12XXX7",buffer.toString());
> 		
> 	}
> RI(Sun JDK 1.5.0_06)   passed
> Harmony failed

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (HARMONY-348) java.lang.StringBuilder.replace does not get right result

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-348?page=all ]
     
Tim Ellison closed HARMONY-348:
-------------------------------


Verified by Paulex.


> java.lang.StringBuilder.replace does not get right result
> ---------------------------------------------------------
>
>          Key: HARMONY-348
>          URL: http://issues.apache.org/jira/browse/HARMONY-348
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: harmony-348.diff
>
> java.lang.StringBuilder.replace(start,end, str) should replace the substring starting at param start and ending at param end -1 with the str parameter, but the Harmony's implementation's behavior is not compliant with spec and RI.  The following test case reproduce the bug:
>  
> public void test_replace()
> 	{
> 		StringBuilder buffer = new StringBuilder("1234567");
> 		buffer.replace(2, 6, "XXX");
> 		assertEquals("12XXX7",buffer.toString());
> 		
> 	}
> RI(Sun JDK 1.5.0_06)   passed
> Harmony failed

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (HARMONY-348) java.lang.StringBuilder.replace does not get right result

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-348?page=all ]
     
Tim Ellison resolved HARMONY-348:
---------------------------------

    Resolution: Fixed

Thanks Paulex.

Fixed in LUNI module java.lang.StringBuilder at repo revision 399206.

Please verify that this fully resolves your problem.


> java.lang.StringBuilder.replace does not get right result
> ---------------------------------------------------------
>
>          Key: HARMONY-348
>          URL: http://issues.apache.org/jira/browse/HARMONY-348
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Paulex Yang
>     Assignee: Tim Ellison
>  Attachments: harmony-348.diff
>
> java.lang.StringBuilder.replace(start,end, str) should replace the substring starting at param start and ending at param end -1 with the str parameter, but the Harmony's implementation's behavior is not compliant with spec and RI.  The following test case reproduce the bug:
>  
> public void test_replace()
> 	{
> 		StringBuilder buffer = new StringBuilder("1234567");
> 		buffer.replace(2, 6, "XXX");
> 		assertEquals("12XXX7",buffer.toString());
> 		
> 	}
> RI(Sun JDK 1.5.0_06)   passed
> Harmony failed

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira