[kaffe] BUG: StringBuffer.substring(...)

Jim Pick jim at kaffe.org
Thu Jun 27 13:58:36 PDT 2002


Thanks for the good bug report.  There was an obvious bug in
StringBuffer.substring(), which I fixed in the head and on the release
branch.

Cheers,

 - Jim

On Sun, 2002-06-23 at 11:13, Mr Alex V Eustrop wrote:
> 
> java.lang.StringBuffer.substring(int start,int end)
> defined since Sun JDK 1.2  dosn't work properly
> 
> 1. Background:
> 
> java.lang.StringBuffer.substring(...) must be equal to
> java.lang.StringBuffer.toString().substring(...)
> but works strange
> 
> 2. Test:
> 
> /*
>  * Kaffe 1.0.6/1.0.7-rc1 StringBuffer.substring() bug
>  */
> 
> import java.util.*;
> import java.io.*;
> 
> public class Tst {
>   public static void main(String[] args) 
>   {
>    StringBuffer tst = new StringBuffer(
>     "# Comment\n%begin 123 \n\n\norg-id: 123\n");
>    System.err.println(1 + tst.substring(0,9));
>    System.err.println(2 + tst.substring(10,21));
>    System.err.println(3 + tst.substring(22,22));
>    System.err.println("--- end of output");
>   }
> } // END OF Tst
> 
> 3. Proper output (with sun jdk1.3.1):
> 
> 1# Comment
> 2%begin 123
> 3
> --- end of output
> 
> A
> 4. Kaffe 1.0.6/1.0.7-rc1 Output:
> 
> 1# Comment
> 2%begin 123 
> 
> 
> org-id:
> 3
> 
> org-id: 123
> 
> --- end of output
> 
> 5. Configuration
> 
>  OS - FreeBSD 4.4-RELENG 
>  kaffe 1.0.6 - from ports
>  or kaffe 1.0.7-rc1 
> 
> -- 
> Eustrop
> 
> _______________________________________________
> kaffe mailing list
> kaffe at kaffe.org
> http://kaffe.org/cgi-bin/mailman/listinfo/kaffe






More information about the kaffe mailing list