Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5045174

StringBuffer append CharSequence is broken in Tiger-Beta2 Build-49

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Not an Issue
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      StringBuffer append CharSequence is broken in Tiger-Beta2 build 49

      Tried on Solaris-9 and WinXP Prof

      How to reproduce, execute the test case mentioned below.

      public class Test3 {
          
          public void assertion1() {
             StringBuffer sb = new StringBuffer();
             for (int i =0; i<127; i++) {
               char ch = (char)i;
               if( Character.isDefined(ch)) {
                  sb .append(ch);
                } else {
                   System.out.println("codepoint is not defined :"+ i);
                }
             }
             StringBuffer sb2 = new StringBuffer((CharSequence)sb);
             System.out.println("sb :"+sb.toString());
             System.out.println("sb2 :"+sb2.toString());
             if(sb.toString().equals(sb2.toString())) {
                  System.out.println("They are same");
             } else {
                  System.out.println("They are different");
             }
             System.out.println("sb length Initially :"+sb.length());
             sb.append((CharSequence)sb2, 4, 6);
             String str = sb2.toString() + sb2.toString().substring(4,10);
             if(sb.toString().equals(str)) {
                System.out.println("Test Pass");
             } else {
                System.out.println("Test Fail");
             }
             System.out.println("sb length :"+sb.length());
             System.out.println("str length :"+str.length());
             
          }
          
          public static void main(String args[]) {
              Test3 ref = new Test3();
              ref.assertion1();
          }

      }

        Attachments

          Activity

            People

            Assignee:
            mmcclosksunw Michael Mccloskey (Inactive)
            Reporter:
            jsinghsunw Jit Singh (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: