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

Alpha Feedback: Severals methods that works with StringBuffer have no StringBuil

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • None
    • sparc
    • solaris_2.5

      Severals methods that works with StringBuffer have no
      StringBuilder equivalent.

      1) There is no contentEquals(StringBuilder) in class String.

      2) In StringBuilder and StringBuffer, there is a
           method append(StringBuffer sb) but no
           append(StringBuilder).

      In case 2, the the code :
          StringBuilder b=new StringBuilder.append(new StringBuilder());

      I think the method append(CharSequence) must be called instead.
      It works but i think that a method append(StringBuilder) could
      perform better using getChar(...) instead of
      a loop over each character.

      The append(StringBuilder) could be inserted to
      AbstractStringBuilder.

      Moreover, the class par of the String documentation have
      lot of links to StringBuffer. I think, all this links
      could be transfered to StringBuilder.

      lot of methods in AbstractStringBuilder return an
          AbstractStringBuilder that is not used in overriden
          counterparts in StringBuffer and StringBuilder.
          Perhaps, this methods could return void to avoid
          a supplementary pop opcode (poor man optimisation :)

            Unassigned Unassigned
            jdriscol Jerry Driscoll (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: