RFR: 6206780 (str) Forwarding append methods in String{Buffer, Builder} are inconsistent

Jim Gish jim.gish at oracle.com
Tue Sep 25 22:03:17 UTC 2012

Please review the change at 

Overview --

  * introduced consistent forwarding to AbstractStringBuilder from
    StringBuffer and StringBuilder for append and other methods per the
    bug report.
  * Added missing @Override annotations.
  * Got rid of knowledge of the sub-classes from ASB (smelled too bad to
    leave in).
  * Retained all methods to maintain compatibility (even though some
    like append(StringBuffer) could go away because append(CharSequence)
    would do).
  * To further maintain compatibility, used sychronized(this) in place
    of adding synchronized methods to those methods in StringBuffer that
    now need it (because of type-based dispatch being done in super
    rather than in /both/ StringBuffer and StringBuilder with
    CharSequence args).
  * Ensured that StringBuffer.append(StringBuilder) and
    StringBuilder.append(StringBuffer) are both handled properly.


Jim Gish | Consulting Member of Technical Staff | +1.781.442.0304
Oracle Java Platform Group | Core Libraries Team
35 Network Drive
Burlington, MA 01803
jim.gish at oracle.com

More information about the core-libs-dev mailing list