Changeset 12431


Ignore:
Timestamp:
02/08/10 08:05:15 (11 years ago)
Author:
Mark Evenson
Message:

Replace FastStringBuffer? with java.lang.StringBuilder?.

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.

Location:
trunk/abcl
Files:
2 deleted
45 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/AbstractString.java

    r12288 r12431  
    9797            Symbol.PRINT_READABLY.symbolValue(thread) != NIL)
    9898        {
    99             FastStringBuffer sb = new FastStringBuffer('"');
     99            StringBuilder sb = new StringBuilder("\"");
    100100            for (int i = beginIndex; i < endIndex; i++) {
    101101                char c = charAt(i);
  • trunk/abcl/src/org/armedbear/lisp/AbstractVector.java

    r12298 r12431  
    152152  protected void badIndex(int index, int limit)
    153153  {
    154     FastStringBuffer sb = new FastStringBuffer("Invalid array index ");
     154    StringBuilder sb = new StringBuilder("Invalid array index ");
    155155    sb.append(index);
    156156    sb.append(" for ");
     
    210210    if (Symbol.PRINT_READABLY.symbolValue(thread) != NIL)
    211211      {
    212         FastStringBuffer sb = new FastStringBuffer("#(");
     212        StringBuilder sb = new StringBuilder("#(");
    213213        final int limit = length();
    214214        for (int i = 0; i < limit; i++)
  • trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java

    r12380 r12431  
    7474  public String writeToString()
    7575  {
    76     FastStringBuffer sb = new FastStringBuffer("#<BUILT-IN-CLASS ");
     76    StringBuilder sb = new StringBuilder("#<BUILT-IN-CLASS ");
    7777    sb.append(symbol.writeToString());
    7878    sb.append('>');
  • trunk/abcl/src/org/armedbear/lisp/Complex.java

    r12288 r12431  
    337337  public String writeToString()
    338338  {
    339     FastStringBuffer sb = new FastStringBuffer("#C(");
     339    StringBuilder sb = new StringBuilder("#C(");
    340340    sb.append(realpart.writeToString());
    341341    sb.append(' ');
  • trunk/abcl/src/org/armedbear/lisp/Cons.java

    r12288 r12431  
    577577    else
    578578      maxLevel = Integer.MAX_VALUE;
    579     FastStringBuffer sb = new FastStringBuffer();
     579    StringBuilder sb = new StringBuilder();
    580580    if (car == Symbol.QUOTE)
    581581      {
  • trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java

    r12288 r12431  
    573573    {
    574574        if (value == Double.POSITIVE_INFINITY) {
    575             FastStringBuffer sb = new FastStringBuffer("#.");
     575            StringBuilder sb = new StringBuilder("#.");
    576576            sb.append(Symbol.DOUBLE_FLOAT_POSITIVE_INFINITY.writeToString());
    577577            return sb.toString();
    578578        }
    579579        if (value == Double.NEGATIVE_INFINITY) {
    580             FastStringBuffer sb = new FastStringBuffer("#.");
     580            StringBuilder sb = new StringBuilder("#.");
    581581            sb.append(Symbol.DOUBLE_FLOAT_NEGATIVE_INFINITY.writeToString());
    582582            return sb.toString();
  • trunk/abcl/src/org/armedbear/lisp/FaslReader.java

    r12290 r12431  
    7474        {
    7575            final Readtable rt = FaslReadtable.getInstance();
    76             FastStringBuffer sb = new FastStringBuffer();
     76            StringBuilder sb = new StringBuilder();
    7777            try
    7878              {
     
    223223            final boolean suppress =
    224224                (Symbol.READ_SUPPRESS.symbolValue(thread) != NIL);
    225             FastStringBuffer sb = new FastStringBuffer();
     225            StringBuilder sb = new StringBuilder();
    226226      try
    227227        {
     
    475475
    476476        {
    477             FastStringBuffer sb =
    478                 new FastStringBuffer("Illegal # macro character: #\\");
     477            StringBuilder sb =
     478                new StringBuilder("Illegal # macro character: #\\");
    479479            String s = LispCharacter.charToName(c);
    480480            if (s != null)
  • trunk/abcl/src/org/armedbear/lisp/Fixnum.java

    r12288 r12431  
    947947    if (Symbol.PRINT_RADIX.symbolValue(thread) != NIL)
    948948      {
    949         FastStringBuffer sb = new FastStringBuffer();
     949        StringBuilder sb = new StringBuilder();
    950950        switch (base)
    951951          {
  • trunk/abcl/src/org/armedbear/lisp/HashTable.java

    r12288 r12431  
    235235        return null; // Not reached.
    236236      }
    237     FastStringBuffer sb = new FastStringBuffer(getTest().writeToString());
     237    StringBuilder sb = new StringBuilder(getTest().writeToString());
    238238    sb.append(' ');
    239239    sb.append(Symbol.HASH_TABLE.writeToString());
  • trunk/abcl/src/org/armedbear/lisp/Interpreter.java

    r12422 r12431  
    260260                            final String separator =
    261261                                System.getProperty("line.separator");
    262                             FastStringBuffer sb = new FastStringBuffer();
     262                            StringBuilder sb = new StringBuilder();
    263263                            sb.append(separator);
    264264                            sb.append("Caught ");
     
    542542    {
    543543        final String sep = System.getProperty("line.separator");
    544         FastStringBuffer sb = new FastStringBuffer("Armed Bear Common Lisp ");
     544        StringBuilder sb = new StringBuilder("Armed Bear Common Lisp ");
    545545        sb.append(Version.getVersion());
    546546        if (build != null) {
  • trunk/abcl/src/org/armedbear/lisp/Java.java

    r12351 r12431  
    324324            }
    325325            catch (NoSuchMethodException e) {
    326                 FastStringBuffer sb = new FastStringBuffer("No such method: ");
     326                StringBuilder sb = new StringBuilder("No such method: ");
    327327                sb.append(c.getName());
    328328                sb.append('.');
  • trunk/abcl/src/org/armedbear/lisp/JavaClass.java

    r12429 r12431  
    9797
    9898  public String writeToString() {
    99     FastStringBuffer sb = new FastStringBuffer("#<JAVA-CLASS ");
     99    StringBuilder sb = new StringBuilder("#<JAVA-CLASS ");
    100100    sb.append(javaClass.getCanonicalName());
    101101    sb.append('>');
  • trunk/abcl/src/org/armedbear/lisp/JavaObject.java

    r12353 r12431  
    304304  if(obj != null) {
    305305      Class<?> c = obj.getClass();
    306       FastStringBuffer sb
    307     = new FastStringBuffer(c.isArray() ? "jarray" : c.getName());
     306      StringBuilder sb
     307    = new StringBuilder(c.isArray() ? "jarray" : c.getName());
    308308      sb.append(' ');
    309309      String ts = obj.toString();
     
    437437  {
    438438  final Object obj = javaObject.getObject();
    439   final FastStringBuffer sb =
    440       new FastStringBuffer(javaObject.writeToString());
     439  final StringBuilder sb =
     440      new StringBuilder(javaObject.writeToString());
    441441  sb.append(" is an object of type ");
    442442  sb.append(Symbol.JAVA_OBJECT.writeToString());
  • trunk/abcl/src/org/armedbear/lisp/Lisp.java

    r12422 r12431  
    10641064
    10651065  {
    1066     FastStringBuffer sb = new FastStringBuffer(prefix);
     1066    StringBuilder sb = new StringBuilder(prefix);
    10671067    SpecialBinding binding = thread.getSpecialBinding(Symbol.GENSYM_COUNTER);
    10681068    final LispObject oldValue;
     
    16771677    if (start < 0 || end < 0 || start > end || end > length)
    16781678      {
    1679         FastStringBuffer sb = new FastStringBuffer("The bounding indices ");
     1679        StringBuilder sb = new StringBuilder("The bounding indices ");
    16801680        sb.append(start);
    16811681        sb.append(" and ");
  • trunk/abcl/src/org/armedbear/lisp/LispCharacter.java

    r12288 r12431  
    9797  public LispObject getDescription()
    9898  {
    99     FastStringBuffer sb = new FastStringBuffer("character #\\");
     99    StringBuilder sb = new StringBuilder("character #\\");
    100100    sb.append(value);
    101101    sb.append(" char-code #x");
     
    241241    boolean printEscape =
    242242      printReadably || (Symbol.PRINT_ESCAPE.symbolValue(thread) != NIL);
    243     FastStringBuffer sb = new FastStringBuffer();
     243    StringBuilder sb = new StringBuilder();
    244244    if (printEscape)
    245245      {
  • trunk/abcl/src/org/armedbear/lisp/LispClass.java

    r12356 r12431  
    7878    if (errorp)
    7979      {
    80         FastStringBuffer sb =
    81           new FastStringBuffer("There is no class named ");
     80        StringBuilder sb =
     81          new StringBuilder("There is no class named ");
    8282        sb.append(name.writeToString());
    8383        sb.append('.');
  • trunk/abcl/src/org/armedbear/lisp/LispObject.java

    r12311 r12431  
    6565  public LispObject getDescription()
    6666  {
    67     FastStringBuffer sb = new FastStringBuffer("An object of type ");
     67    StringBuilder sb = new StringBuilder("An object of type ");
    6868    sb.append(typeOf().writeToString());
    6969    sb.append(" at #x");
     
    683683  public String unreadableString(String s, boolean identity)
    684684  {
    685     FastStringBuffer sb = new FastStringBuffer("#<");
     685    StringBuilder sb = new StringBuilder("#<");
    686686    sb.append(s);
    687687    if (identity) {
  • trunk/abcl/src/org/armedbear/lisp/LispReader.java

    r12328 r12431  
    7575            final LispThread thread = LispThread.currentThread();
    7676            final Readtable rt = (Readtable) Symbol.CURRENT_READTABLE.symbolValue(thread);
    77             FastStringBuffer sb = new FastStringBuffer();
     77            StringBuilder sb = new StringBuilder();
    7878            try
    7979              {
     
    223223            final Readtable rt = (Readtable) Symbol.CURRENT_READTABLE.symbolValue(thread);
    224224            final boolean suppress = Symbol.READ_SUPPRESS.symbolValue(thread) != NIL;
    225             FastStringBuffer sb = new FastStringBuffer();
     225            StringBuilder sb = new StringBuilder();
    226226            try
    227227              {
     
    468468
    469469        {
    470             FastStringBuffer sb = new FastStringBuffer("Illegal # macro character: #\\");
     470            StringBuilder sb = new StringBuilder("Illegal # macro character: #\\");
    471471            String s = LispCharacter.charToName(c);
    472472            if (s != null)
  • trunk/abcl/src/org/armedbear/lisp/Load.java

    r12427 r12431  
    188188        }
    189189        catch (FaslVersionMismatch e) {
    190             FastStringBuffer sb =
    191                 new FastStringBuffer("Incorrect fasl version: ");
     190            StringBuilder sb =
     191                new StringBuilder("Incorrect fasl version: ");
    192192            sb.append(truename);
    193193            return error(new SimpleError(sb.toString()));
     
    302302                                          verbose, print, auto);
    303303            } catch (FaslVersionMismatch e) {
    304                 FastStringBuffer sb =
    305                     new FastStringBuffer("; Incorrect fasl version: ");
     304                StringBuilder sb =
     305                    new StringBuilder("; Incorrect fasl version: ");
    306306                sb.append(truename);
    307307                System.err.println(sb.toString());
     
    484484    public static String getLoadVerbosePrefix(int loadDepth)
    485485    {
    486         FastStringBuffer sb = new FastStringBuffer(";");
     486        StringBuilder sb = new StringBuilder(";");
    487487        for (int i = loadDepth - 1; i-- > 0;)
    488488            sb.append(' ');
  • trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java

    r12422 r12431  
    204204    protected String getDirectoryNamestring()
    205205    {
    206         FastStringBuffer sb = new FastStringBuffer();
     206        StringBuilder sb = new StringBuilder();
    207207        // "If a pathname is converted to a namestring, the symbols NIL and
    208208        // :UNSPECIFIC cause the field to be treated as if it were empty. That
     
    245245        boolean printReadably = (Symbol.PRINT_READABLY.symbolValue(thread) != NIL);
    246246        boolean printEscape = (Symbol.PRINT_ESCAPE.symbolValue(thread) != NIL);
    247         FastStringBuffer sb = new FastStringBuffer();
     247        StringBuilder sb = new StringBuilder();
    248248        if (printReadably || printEscape)
    249249            sb.append("#P\"");
  • trunk/abcl/src/org/armedbear/lisp/Package.java

    r12375 r12431  
    8989    {
    9090        if (name != null) {
    91             FastStringBuffer sb = new FastStringBuffer("The ");
     91            StringBuilder sb = new StringBuilder("The ");
    9292            sb.append(name);
    9393            sb.append(" package");
     
    406406                            sym = s;
    407407                        else if (sym != s) {
    408                             FastStringBuffer sb =
    409                                 new FastStringBuffer("Uninterning the symbol ");
     408                            StringBuilder sb =
     409                                new StringBuilder("Uninterning the symbol ");
    410410                            sb.append(symbol.getQualifiedName());
    411411                            sb.append(" causes a name conflict between ");
     
    443443        Symbol sym = findAccessibleSymbol(symbol.name);
    444444        if (sym != null && sym != symbol) {
    445             FastStringBuffer sb = new FastStringBuffer("The symbol ");
     445            StringBuilder sb = new StringBuilder("The symbol ");
    446446            sb.append(sym.getQualifiedName());
    447447            sb.append(" is already accessible in package ");
     
    462462            Symbol sym = findAccessibleSymbol(symbol.name);
    463463            if (sym != symbol) {
    464                 FastStringBuffer sb = new FastStringBuffer("The symbol ");
     464                StringBuilder sb = new StringBuilder("The symbol ");
    465465                sb.append(symbol.getQualifiedName());
    466466                sb.append(" is not accessible in package ");
     
    483483                            // OK.
    484484                        } else {
    485                             FastStringBuffer sb = new FastStringBuffer("The symbol ");
     485                            StringBuilder sb = new StringBuilder("The symbol ");
    486486                            sb.append(sym.getQualifiedName());
    487487                            sb.append(" is already accessible in package ");
     
    502502            // Symbol is already exported; there's nothing to do.
    503503            return;
    504         FastStringBuffer sb = new FastStringBuffer("The symbol ");
     504        StringBuilder sb = new StringBuilder("The symbol ");
    505505        sb.append(symbol.getQualifiedName());
    506506        sb.append(" is not accessible in package ");
     
    529529                }
    530530            }
    531             FastStringBuffer sb = new FastStringBuffer("The symbol ");
     531            StringBuilder sb = new StringBuilder("The symbol ");
    532532            sb.append(symbol.getQualifiedName());
    533533            sb.append(" is not accessible in package ");
     
    826826    {
    827827        if (_PRINT_FASL_.symbolValue() != NIL && name != null) {
    828             FastStringBuffer sb = new FastStringBuffer("#.(FIND-PACKAGE \"");
     828            StringBuilder sb = new StringBuilder("#.(FIND-PACKAGE \"");
    829829            sb.append(name);
    830830            sb.append("\")");
     
    837837    public String toString() {
    838838         if (name != null) {
    839             FastStringBuffer sb = new FastStringBuffer("#<PACKAGE \"");
     839            StringBuilder sb = new StringBuilder("#<PACKAGE \"");
    840840            sb.append(name);
    841841            sb.append("\">");
  • trunk/abcl/src/org/armedbear/lisp/Pathname.java

    r12422 r12431  
    471471            Debug.assertTrue(false);
    472472        }
    473         FastStringBuffer sb = new FastStringBuffer();
     473        StringBuilder sb = new StringBuilder();
    474474        // "If a pathname is converted to a namestring, the symbols NIL and
    475475        // :UNSPECIFIC cause the field to be treated as if it were empty. That
     
    499499                i = 1;
    500500            }
    501             FastStringBuffer prefix = new FastStringBuffer();
     501            StringBuilder prefix = new StringBuilder();
    502502            for (; i < jars.length; i++) {
    503503                prefix.append("jar:");
     
    569569    protected String getDirectoryNamestring() {
    570570        validateDirectory(true);
    571         FastStringBuffer sb = new FastStringBuffer();
     571        StringBuilder sb = new StringBuilder();
    572572        // "If a pathname is converted to a namestring, the symbols NIL and
    573573        // :UNSPECIFIC cause the field to be treated as if it were empty. That
     
    734734            useNamestring = false;
    735735        }
    736         FastStringBuffer sb = new FastStringBuffer();
     736        StringBuilder sb = new StringBuilder();
    737737        if (useNamestring) {
    738738            if (printReadably || printEscape) {
     
    11831183                if (second == Keyword.UP || second == Keyword.BACK) {
    11841184                    if (signalError) {
    1185                         FastStringBuffer sb = new FastStringBuffer();
     1185                        StringBuilder sb = new StringBuilder();
    11861186                        sb.append(first.writeToString());
    11871187                        sb.append(" may not be followed immediately by ");
     
    16841684        error:
    16851685        if (errorIfDoesNotExist) {
    1686             FastStringBuffer sb = new FastStringBuffer("The file ");
     1686            StringBuilder sb = new StringBuilder("The file ");
    16871687            sb.append(pathname.writeToString());
    16881688            sb.append(" does not exist.");
     
    19581958          public LispObject execute(LispObject arg) {
    19591959              Pathname p = coerceToPathname(arg);
    1960               FastStringBuffer sb = new FastStringBuffer();
     1960              StringBuilder sb = new StringBuilder();
    19611961              if (p.name instanceof AbstractString) {
    19621962                  sb.append(p.name.getStringValue());
  • trunk/abcl/src/org/armedbear/lisp/Primitives.java

    r12408 r12431  
    21792179        if (rank != args.length - 1)
    21802180          {
    2181             FastStringBuffer sb =
    2182               new FastStringBuffer("ARRAY-IN-BOUNDS-P: ");
     2181            StringBuilder sb =
     2182              new StringBuilder("ARRAY-IN-BOUNDS-P: ");
    21832183            sb.append("wrong number of subscripts (");
    21842184            sb.append(args.length - 1);
     
    22362236        if (array.getRank() == 0)
    22372237          return array.AREF(0);
    2238         FastStringBuffer sb =
    2239           new FastStringBuffer("Wrong number of subscripts (0) for array of rank ");
     2238        StringBuilder sb =
     2239          new StringBuilder("Wrong number of subscripts (0) for array of rank ");
    22402240        sb.append(array.getRank());
    22412241        sb.append('.');
     
    29462946            if (n >= 0)
    29472947              {
    2948                 FastStringBuffer sb = new FastStringBuffer('G');
     2948                StringBuilder sb = new StringBuilder("G");
    29492949                sb.append(n); // Decimal representation.
    29502950                return new Symbol(new SimpleString(sb));
     
    29562956            if (n.signum() >= 0)
    29572957              {
    2958                 FastStringBuffer sb = new FastStringBuffer('G');
     2958                StringBuilder sb = new StringBuilder("G");
    29592959                sb.append(n.toString()); // Decimal representation.
    29602960                return new Symbol(new SimpleString(sb));
     
    41104110        if (start < 0)
    41114111          {
    4112             FastStringBuffer sb = new FastStringBuffer("Bad start index (");
     4112            StringBuilder sb = new StringBuilder("Bad start index (");
    41134113            sb.append(start);
    41144114            sb.append(") for SUBSEQ.");
     
    41324132        if (start < 0)
    41334133          {
    4134             FastStringBuffer sb = new FastStringBuffer("Bad start index (");
     4134            StringBuilder sb = new StringBuilder("Bad start index (");
    41354135            sb.append(start);
    41364136            sb.append(").");
     
    41434143            if (start > end)
    41444144              {
    4145                 FastStringBuffer sb = new FastStringBuffer("Start index (");
     4145                StringBuilder sb = new StringBuilder("Start index (");
    41464146                sb.append(start);
    41474147                sb.append(") is greater than end index (");
  • trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java

    r12298 r12431  
    8282    public String getMessage()
    8383    {
    84         FastStringBuffer sb = new FastStringBuffer();
     84        StringBuilder sb = new StringBuilder();
    8585        LispObject object = UNBOUND_VALUE;
    8686        object = getInstanceSlotValue(Symbol.OBJECT);
  • trunk/abcl/src/org/armedbear/lisp/Readtable.java

    r12288 r12431  
    238238      {
    239239        String name = LispCharacter.charToName(c);
    240         FastStringBuffer sb = new FastStringBuffer("Invalid character");
     240        StringBuilder sb = new StringBuilder("Invalid character");
    241241        if (name != null)
    242242          {
  • trunk/abcl/src/org/armedbear/lisp/Return.java

    r12298 r12431  
    7272    public LispObject getCondition()
    7373    {
    74         FastStringBuffer sb = new FastStringBuffer("No block named ");
     74        StringBuilder sb = new StringBuilder("No block named ");
    7575        sb.append(tag.writeToString());
    7676        sb.append(" is currently visible.");
  • trunk/abcl/src/org/armedbear/lisp/ShellCommand.java

    r12298 r12431  
    8686                if (Utilities.isPlatformUnix) {
    8787                    if (directory != null) {
    88                         FastStringBuffer sb = new FastStringBuffer("\\cd \"");
     88                        StringBuilder sb = new StringBuilder("\\cd \"");
    8989                        sb.append(directory);
    9090                        sb.append("\" && ");
     
    101101                    list.add("/c");
    102102                    if (directory != null) {
    103                         FastStringBuffer sb = new FastStringBuffer("cd /d \"");
     103                        StringBuilder sb = new StringBuilder("cd /d \"");
    104104                        sb.append(directory);
    105105                        sb.append("\" && ");
  • trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java

    r12288 r12431  
    254254    if (rank != subscripts.length)
    255255      {
    256         FastStringBuffer sb = new FastStringBuffer("Wrong number of subscripts (");
     256        StringBuilder sb = new StringBuilder("Wrong number of subscripts (");
    257257        sb.append(subscripts.length);
    258258        sb.append(") for array of rank ");
     
    271271        if (n < 0 || n >= dim)
    272272          {
    273             FastStringBuffer sb = new FastStringBuffer("Invalid index ");
     273            StringBuilder sb = new StringBuilder("Invalid index ");
    274274            sb.append(n);
    275275            sb.append(" for array ");
  • trunk/abcl/src/org/armedbear/lisp/SimpleString.java

    r12288 r12431  
    7373    }
    7474
    75     public SimpleString(FastStringBuffer sb)
    76     {
    77         chars = sb.toCharArray();
     75    public SimpleString(StringBuilder sb)
     76    {
     77        chars = sb.toString().toCharArray();
    7878        capacity = chars.length;
    7979    }
     
    112112    public LispObject getDescription()
    113113    {
    114         FastStringBuffer sb = new FastStringBuffer("A simple-string (");
     114        StringBuilder sb = new StringBuilder("A simple-string (");
    115115        sb.append(capacity);
    116116        sb.append(") \"");
  • trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java

    r12298 r12431  
    8989  public String writeToString()
    9090  {
    91     FastStringBuffer sb =
    92       new FastStringBuffer(Symbol.SLOT_DEFINITION.writeToString());
     91    StringBuilder sb =
     92      new StringBuilder(Symbol.SLOT_DEFINITION.writeToString());
    9393    LispObject name = slots[SlotDefinitionClass.SLOT_INDEX_NAME];
    9494    if (name != null && name != NIL)
  • trunk/abcl/src/org/armedbear/lisp/StandardClass.java

    r12288 r12431  
    8888  public String writeToString()
    8989  {
    90     FastStringBuffer sb =
    91       new FastStringBuffer(Symbol.STANDARD_CLASS.writeToString());
     90    StringBuilder sb =
     91      new StringBuilder(Symbol.STANDARD_CLASS.writeToString());
    9292    if (symbol != null)
    9393      {
  • trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java

    r12288 r12431  
    209209    if (name != null)
    210210      {
    211         FastStringBuffer sb = new FastStringBuffer();
     211        StringBuilder sb = new StringBuilder();
    212212        sb.append(getLispClass().getSymbol().writeToString());
    213213        sb.append(' ');
  • trunk/abcl/src/org/armedbear/lisp/StandardMethod.java

    r12288 r12431  
    156156        if (name != null)
    157157          {
    158             FastStringBuffer sb = new FastStringBuffer();
     158            StringBuilder sb = new StringBuilder();
    159159            sb.append(getLispClass().getSymbol().writeToString());
    160160            sb.append(' ');
  • trunk/abcl/src/org/armedbear/lisp/Stream.java

    r12422 r12431  
    554554        final Readtable rt =
    555555            (Readtable) Symbol.CURRENT_READTABLE.symbolValue(LispThread.currentThread());
    556         FastStringBuffer sb = new FastStringBuffer();
     556        StringBuilder sb = new StringBuilder();
    557557        _readToken(sb, rt);
    558558        return new Symbol(sb.toString());
     
    560560
    561561    public LispObject readSymbol(Readtable rt) {
    562         FastStringBuffer sb = new FastStringBuffer();
     562        StringBuilder sb = new StringBuilder();
    563563        _readToken(sb, rt);
    564564        return new Symbol(sb.toString());
     
    785785                return error(new EndOfFile(this));
    786786            char c = (char) n; // ### BUG: Codepoint conversion
    787             FastStringBuffer sb = new FastStringBuffer(c);
     787            StringBuilder sb = new StringBuilder(String.valueOf(c));
    788788            while (true) {
    789789                n = _readChar();
     
    888888            return Complex.getInstance(obj.car(), obj.cadr());
    889889        // Error.
    890         FastStringBuffer sb = new FastStringBuffer("Invalid complex number format");
     890        StringBuilder sb = new StringBuilder("Invalid complex number format");
    891891        if (this instanceof FileStream) {
    892892            Pathname p = ((FileStream)this).getPathname();
     
    915915            return Complex.getInstance(obj.car(), obj.cadr());
    916916        // Error.
    917         FastStringBuffer sb = new FastStringBuffer("Invalid complex number format");
     917        StringBuilder sb = new StringBuilder("Invalid complex number format");
    918918        if (this instanceof FileStream) {
    919919            Pathname p = ((FileStream)this).getPathname();
     
    935935
    936936    private String readMultipleEscape(Readtable rt) {
    937         FastStringBuffer sb = new FastStringBuffer();
     937        StringBuilder sb = new StringBuilder();
    938938        try {
    939939            while (true) {
     
    995995
    996996    {
    997         FastStringBuffer sb = new FastStringBuffer(c);
     997        StringBuilder sb = new StringBuilder(String.valueOf(c));
    998998        final LispThread thread = LispThread.currentThread();
    999999        BitSet flags = _readToken(sb, rt);
     
    10861086    }
    10871087
    1088     private final BitSet _readToken(FastStringBuffer sb, Readtable rt)
     1088    private final BitSet _readToken(StringBuilder sb, Readtable rt)
    10891089
    10901090    {
     
    11991199            }
    12001200        }
    1201         FastStringBuffer sb = new FastStringBuffer(limit);
     1201        StringBuilder sb = new StringBuilder(limit);
    12021202        for (int i = 0; i < limit; i++) {
    12031203            char c = s.charAt(i);
     
    13121312        if (length == 0)
    13131313            return null;
    1314         FastStringBuffer sb = new FastStringBuffer();
     1314        StringBuilder sb = new StringBuilder();
    13151315        int i = 0;
    13161316        boolean maybe = false;
     
    13741374
    13751375    public LispObject readRadix(int radix) {
    1376         FastStringBuffer sb = new FastStringBuffer();
     1376        StringBuilder sb = new StringBuilder();
    13771377        final LispThread thread = LispThread.currentThread();
    13781378        final Readtable rt =
     
    14031403
    14041404    public LispObject faslReadRadix(int radix) {
    1405         FastStringBuffer sb = new FastStringBuffer();
     1405        StringBuilder sb = new StringBuilder();
    14061406        final LispThread thread = LispThread.currentThread();
    14071407        final Readtable rt = FaslReadtable.getInstance();
     
    14721472    {
    14731473        final LispThread thread = LispThread.currentThread();
    1474         FastStringBuffer sb = new FastStringBuffer();
     1474        StringBuilder sb = new StringBuilder();
    14751475        try {
    14761476            while (true) {
  • trunk/abcl/src/org/armedbear/lisp/StringFunctions.java

    r12290 r12431  
    585585            if (start > end)
    586586                return error(new TypeError("Start (" + start + ") is greater than end (" + end + ")."));
    587             FastStringBuffer sb = new FastStringBuffer(length);
     587            StringBuilder sb = new StringBuilder(length);
    588588            char[] array = s.getStringChars();
    589589            int i;
     
    620620            if (start > end)
    621621                return error(new TypeError("Start (" + start + ") is greater than end (" + end + ")."));
    622             FastStringBuffer sb = new FastStringBuffer(length);
     622            StringBuilder sb = new StringBuilder(length);
    623623            char[] array = s.getStringChars();
    624624            int i;
     
    656656            if (start > end)
    657657                return error(new TypeError("Start (" + start + ") is greater than end (" + end + ")."));
    658             FastStringBuffer sb = new FastStringBuffer(length);
     658            StringBuilder sb = new StringBuilder(length);
    659659            char[] array = s.getStringChars();
    660660            boolean lastCharWasAlphanumeric = false;
     
    814814            final int n = Fixnum.getValue(size);
    815815            if (n < 0 || n >= ARRAY_DIMENSION_MAX) {
    816                 FastStringBuffer sb = new FastStringBuffer();
     816                StringBuilder sb = new StringBuilder();
    817817                sb.append("The size specified for this string (");
    818818                sb.append(n);
  • trunk/abcl/src/org/armedbear/lisp/StructureObject.java

    r12362 r12431  
    378378  private LispObject badIndex(int n)
    379379  {
    380     FastStringBuffer sb = new FastStringBuffer("Invalid slot index ");
     380    StringBuilder sb = new StringBuilder("Invalid slot index ");
    381381    sb.append(Fixnum.getInstance(n).writeToString());
    382382    sb.append(" for ");
     
    432432        if (currentLevel >= maxLevel && slots.length > 0)
    433433          return "#";
    434         FastStringBuffer sb = new FastStringBuffer("#S(");
     434        StringBuilder sb = new StringBuilder("#S(");
    435435        sb.append(structureClass.getSymbol().writeToString());
    436436        if (currentLevel < maxLevel)
  • trunk/abcl/src/org/armedbear/lisp/Symbol.java

    r12422 r12431  
    119119    try
    120120      {
    121         FastStringBuffer sb = new FastStringBuffer("The symbol ");
     121        StringBuilder sb = new StringBuilder("The symbol ");
    122122        sb.append(name.writeToString());
    123123        sb.append(" at #x");
     
    258258    if (pkg == PACKAGE_KEYWORD)
    259259      return ":".concat(n);
    260     FastStringBuffer sb = new FastStringBuffer(((Package)pkg).getName());
     260    StringBuilder sb = new StringBuilder(((Package)pkg).getName());
    261261    if (((Package)pkg).findExternalSymbol(name) != null)
    262262      sb.append(':');
     
    445445            printCase != Keyword.UPCASE)
    446446          {
    447             FastStringBuffer sb = new FastStringBuffer();
     447            StringBuilder sb = new StringBuilder();
    448448            if (pkg == PACKAGE_KEYWORD)
    449449              {
     
    573573          }
    574574      }
    575     FastStringBuffer sb = new FastStringBuffer(packageName);
     575    StringBuilder sb = new StringBuilder(packageName);
    576576    if (((Package)pkg).findExternalSymbol(name) != null
    577577        && DOUBLE_COLON_PACKAGE_SEPARATORS.symbolValue(thread) == NIL)
     
    608608          }
    609609      }
    610     FastStringBuffer sb = new FastStringBuffer(limit);
     610    StringBuilder sb = new StringBuilder(limit);
    611611    for (int i = 0; i < limit; i++)
    612612      {
     
    696696  private static final String multipleEscape(String s)
    697697  {
    698     FastStringBuffer sb = new FastStringBuffer("|");
     698    StringBuilder sb = new StringBuilder("|");
    699699    final int limit = s.length();
    700700    for (int i = 0; i < limit; i++)
     
    714714      return s;
    715715    final int limit = s.length();
    716     FastStringBuffer sb = new FastStringBuffer(limit);
     716    StringBuilder sb = new StringBuilder(limit);
    717717    boolean lastCharWasAlphanumeric = false;
    718718    for (int i = 0; i < limit; i++)
  • trunk/abcl/src/org/armedbear/lisp/Time.java

    r12290 r12431  
    6363              checkCharacterOutputStream(Symbol.TRACE_OUTPUT.symbolValue());
    6464            out.freshLine();
    65             FastStringBuffer sb = new FastStringBuffer();
     65            StringBuilder sb = new StringBuilder();
    6666            sb.append(String.valueOf((float)realElapsed / 1000));
    6767            sb.append(" seconds real time");
  • trunk/abcl/src/org/armedbear/lisp/TypeError.java

    r12298 r12431  
    139139            final LispObject datum = getDatum();
    140140            final LispObject expectedType = getExpectedType();
    141             FastStringBuffer sb = new FastStringBuffer();
     141            StringBuilder sb = new StringBuilder();
    142142            String name = datum != null ? datum.writeToString() : null;
    143143            String type = null;
  • trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java

    r12288 r12431  
    7676        thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
    7777        try {
    78             FastStringBuffer sb = new FastStringBuffer("The slot ");
     78            StringBuilder sb = new StringBuilder("The slot ");
    7979            sb.append(getCellName().writeToString());
    8080            sb.append(" is unbound in the object ");
  • trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java

    r12288 r12431  
    7373  public String getMessage()
    7474  {
    75     FastStringBuffer sb = new FastStringBuffer("The function ");
     75    StringBuilder sb = new StringBuilder("The function ");
    7676    sb.append(getCellName().writeToString());
    7777    sb.append(" is undefined.");
  • trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java

    r12350 r12431  
    7272      return message;
    7373  }
    74         FastStringBuffer sb =
    75             new FastStringBuffer("Wrong number of arguments");
     74        StringBuilder sb =
     75            new StringBuilder("Wrong number of arguments");
    7676        LispObject lambdaName = operator.getLambdaName();
    7777        if (lambdaName != null && lambdaName != NIL) {
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r12425 r12431  
    538538  (getf canonical-slot :name))
    539539
    540 (defun ensure-class (name &rest all-keys
    541                      &key (metaclass 'standard-class) &allow-other-keys)
    542 
    543   ;; Don't pass METACLASS on to the initialization routines
    544   ;; This only works because we *know* ABCL conses up new &rest lists
    545   ;; every time; otherwise, modifying the argument list is discouraged by the spec
    546   (remf all-keys :metaclass)
    547 
     540(defun ensure-class (name &rest all-keys &allow-other-keys)
    548541  ;; Check for duplicate slots.
    549542  (let ((slots (getf all-keys :direct-slots)))
     
    590583                  old-class)))
    591584          (t
    592            (let ((class (apply (if (eq metaclass 'standard-class)
    593                                    #'make-instance-standard-class
    594                                    #'make-instance)
    595                                (or (when (symbolp metaclass)
    596                                      (find-class metaclass))
    597                                    metaclass)
     585           (let ((class (apply #'make-instance-standard-class
     586                               (find-class 'standard-class)
    598587                               :name name all-keys)))
    599588             (%set-find-class name class)
  • trunk/abcl/src/org/armedbear/lisp/delete_file.java

    r12288 r12431  
    7878            }
    7979            Pathname truename = new Pathname(file.getAbsolutePath());
    80             FastStringBuffer sb = new FastStringBuffer("Unable to delete ");
     80            StringBuilder sb = new StringBuilder("Unable to delete ");
    8181            sb.append(file.isDirectory() ? "directory " : "file ");
    8282            sb.append(truename.writeToString());
  • trunk/abcl/src/org/armedbear/lisp/make_array.java

    r12288 r12431  
    127127        if (size < 0 || size >= ARRAY_DIMENSION_MAX)
    128128          {
    129             FastStringBuffer sb = new FastStringBuffer();
     129            StringBuilder sb = new StringBuilder();
    130130            sb.append("The size specified for this array (");
    131131            sb.append(size);
Note: See TracChangeset for help on using the changeset viewer.