Skip to content
  • mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar
    Replace FastStringBuffer with java.lang.StringBuilder. · d50aa273
    Phil Hudson suggested in Feburary 2009 that "[FastStringBuffer] should
    be removed with all references to it replaced with
    java.lang.StringBuilder once enough confidence in this change has been
    gained."  After almost a year of using FastStringBuffer as a delagate
    for StringBuilder, that confidence has indeed been gained.
    
    One subtlety for use of StringBuilder: there is no
    
        StringBuilder(char)
    
    constructor, so use
    
        StringBuilder(String.valueOf(c))
    
    to construct a new StringBuilder containing a single char.  Otherwise
    that char will get promoted to an int, and you will invoke
    
        StringBuilder(int capacity)
    
    which will "swallow" the first character that you thought you were adding.
    d50aa273