[armedbear-cvs] r12431 - in trunk/abcl: src/org/armedbear/lisp test/src/org/armedbear/lisp

Mark Evenson mevenson at common-lisp.net
Mon Feb 8 08:05:16 UTC 2010


Author: mevenson
Date: Mon Feb  8 03:05:15 2010
New Revision: 12431

Log:
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.



Removed:
   trunk/abcl/src/org/armedbear/lisp/FastStringBuffer.java
   trunk/abcl/test/src/org/armedbear/lisp/FastStringBufferTest.java
Modified:
   trunk/abcl/src/org/armedbear/lisp/AbstractString.java
   trunk/abcl/src/org/armedbear/lisp/AbstractVector.java
   trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java
   trunk/abcl/src/org/armedbear/lisp/Complex.java
   trunk/abcl/src/org/armedbear/lisp/Cons.java
   trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java
   trunk/abcl/src/org/armedbear/lisp/FaslReader.java
   trunk/abcl/src/org/armedbear/lisp/Fixnum.java
   trunk/abcl/src/org/armedbear/lisp/HashTable.java
   trunk/abcl/src/org/armedbear/lisp/Interpreter.java
   trunk/abcl/src/org/armedbear/lisp/Java.java
   trunk/abcl/src/org/armedbear/lisp/JavaClass.java
   trunk/abcl/src/org/armedbear/lisp/JavaObject.java
   trunk/abcl/src/org/armedbear/lisp/Lisp.java
   trunk/abcl/src/org/armedbear/lisp/LispCharacter.java
   trunk/abcl/src/org/armedbear/lisp/LispClass.java
   trunk/abcl/src/org/armedbear/lisp/LispObject.java
   trunk/abcl/src/org/armedbear/lisp/LispReader.java
   trunk/abcl/src/org/armedbear/lisp/Load.java
   trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java
   trunk/abcl/src/org/armedbear/lisp/Package.java
   trunk/abcl/src/org/armedbear/lisp/Pathname.java
   trunk/abcl/src/org/armedbear/lisp/Primitives.java
   trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java
   trunk/abcl/src/org/armedbear/lisp/Readtable.java
   trunk/abcl/src/org/armedbear/lisp/Return.java
   trunk/abcl/src/org/armedbear/lisp/ShellCommand.java
   trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java
   trunk/abcl/src/org/armedbear/lisp/SimpleString.java
   trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java
   trunk/abcl/src/org/armedbear/lisp/StandardClass.java
   trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java
   trunk/abcl/src/org/armedbear/lisp/StandardMethod.java
   trunk/abcl/src/org/armedbear/lisp/Stream.java
   trunk/abcl/src/org/armedbear/lisp/StringFunctions.java
   trunk/abcl/src/org/armedbear/lisp/StructureObject.java
   trunk/abcl/src/org/armedbear/lisp/Symbol.java
   trunk/abcl/src/org/armedbear/lisp/Time.java
   trunk/abcl/src/org/armedbear/lisp/TypeError.java
   trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java
   trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java
   trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java
   trunk/abcl/src/org/armedbear/lisp/clos.lisp
   trunk/abcl/src/org/armedbear/lisp/delete_file.java
   trunk/abcl/src/org/armedbear/lisp/make_array.java

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractString.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractString.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractString.java	Mon Feb  8 03:05:15 2010
@@ -96,7 +96,7 @@
         if (Symbol.PRINT_ESCAPE.symbolValue(thread) != NIL ||
             Symbol.PRINT_READABLY.symbolValue(thread) != NIL)
         {
-            FastStringBuffer sb = new FastStringBuffer('"');
+            StringBuilder sb = new StringBuilder("\"");
             for (int i = beginIndex; i < endIndex; i++) {
                 char c = charAt(i);
                 if (c == '\"' || c == '\\')

Modified: trunk/abcl/src/org/armedbear/lisp/AbstractVector.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/AbstractVector.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/AbstractVector.java	Mon Feb  8 03:05:15 2010
@@ -151,7 +151,7 @@
 
   protected void badIndex(int index, int limit)
   {
-    FastStringBuffer sb = new FastStringBuffer("Invalid array index ");
+    StringBuilder sb = new StringBuilder("Invalid array index ");
     sb.append(index);
     sb.append(" for ");
     sb.append(writeToString());
@@ -209,7 +209,7 @@
     final LispThread thread = LispThread.currentThread();
     if (Symbol.PRINT_READABLY.symbolValue(thread) != NIL)
       {
-        FastStringBuffer sb = new FastStringBuffer("#(");
+        StringBuilder sb = new StringBuilder("#(");
         final int limit = length();
         for (int i = 0; i < limit; i++)
           {

Modified: trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/BuiltInClass.java	Mon Feb  8 03:05:15 2010
@@ -73,7 +73,7 @@
   @Override
   public String writeToString()
   {
-    FastStringBuffer sb = new FastStringBuffer("#<BUILT-IN-CLASS ");
+    StringBuilder sb = new StringBuilder("#<BUILT-IN-CLASS ");
     sb.append(symbol.writeToString());
     sb.append('>');
     return sb.toString();

Modified: trunk/abcl/src/org/armedbear/lisp/Complex.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Complex.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Complex.java	Mon Feb  8 03:05:15 2010
@@ -336,7 +336,7 @@
   @Override
   public String writeToString()
   {
-    FastStringBuffer sb = new FastStringBuffer("#C(");
+    StringBuilder sb = new StringBuilder("#C(");
     sb.append(realpart.writeToString());
     sb.append(' ');
     sb.append(imagpart.writeToString());

Modified: trunk/abcl/src/org/armedbear/lisp/Cons.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Cons.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Cons.java	Mon Feb  8 03:05:15 2010
@@ -576,7 +576,7 @@
       maxLevel = ((Fixnum)printLevel).value;
     else
       maxLevel = Integer.MAX_VALUE;
-    FastStringBuffer sb = new FastStringBuffer();
+    StringBuilder sb = new StringBuilder();
     if (car == Symbol.QUOTE)
       {
         if (cdr instanceof Cons)

Modified: trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/DoubleFloat.java	Mon Feb  8 03:05:15 2010
@@ -572,12 +572,12 @@
     public String writeToString()
     {
         if (value == Double.POSITIVE_INFINITY) {
-            FastStringBuffer sb = new FastStringBuffer("#.");
+            StringBuilder sb = new StringBuilder("#.");
             sb.append(Symbol.DOUBLE_FLOAT_POSITIVE_INFINITY.writeToString());
             return sb.toString();
         }
         if (value == Double.NEGATIVE_INFINITY) {
-            FastStringBuffer sb = new FastStringBuffer("#.");
+            StringBuilder sb = new StringBuilder("#.");
             sb.append(Symbol.DOUBLE_FLOAT_NEGATIVE_INFINITY.writeToString());
             return sb.toString();
         }

Modified: trunk/abcl/src/org/armedbear/lisp/FaslReader.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/FaslReader.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/FaslReader.java	Mon Feb  8 03:05:15 2010
@@ -73,7 +73,7 @@
 
         {
             final Readtable rt = FaslReadtable.getInstance();
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
             try 
               {
                 while (true) {
@@ -222,7 +222,7 @@
             final Readtable rt = FaslReadtable.getInstance();
             final boolean suppress =
                 (Symbol.READ_SUPPRESS.symbolValue(thread) != NIL);
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
 	    try 
 	      {
 		while (true) {
@@ -474,8 +474,8 @@
         public LispObject execute(Stream stream, char c, int n)
 
         {
-            FastStringBuffer sb =
-                new FastStringBuffer("Illegal # macro character: #\\");
+            StringBuilder sb =
+                new StringBuilder("Illegal # macro character: #\\");
             String s = LispCharacter.charToName(c);
             if (s != null)
                 sb.append(s);

Modified: trunk/abcl/src/org/armedbear/lisp/Fixnum.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Fixnum.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Fixnum.java	Mon Feb  8 03:05:15 2010
@@ -946,7 +946,7 @@
     String s = Integer.toString(value, base).toUpperCase();
     if (Symbol.PRINT_RADIX.symbolValue(thread) != NIL)
       {
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         switch (base)
           {
           case 2:

Modified: trunk/abcl/src/org/armedbear/lisp/HashTable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/HashTable.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/HashTable.java	Mon Feb  8 03:05:15 2010
@@ -234,7 +234,7 @@
         error(new PrintNotReadable(list(Keyword.OBJECT, this)));
         return null; // Not reached.
       }
-    FastStringBuffer sb = new FastStringBuffer(getTest().writeToString());
+    StringBuilder sb = new StringBuilder(getTest().writeToString());
     sb.append(' ');
     sb.append(Symbol.HASH_TABLE.writeToString());
     sb.append(' ');

Modified: trunk/abcl/src/org/armedbear/lisp/Interpreter.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Interpreter.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Interpreter.java	Mon Feb  8 03:05:15 2010
@@ -259,7 +259,7 @@
                         catch (UnhandledCondition c) {
                             final String separator =
                                 System.getProperty("line.separator");
-                            FastStringBuffer sb = new FastStringBuffer();
+                            StringBuilder sb = new StringBuilder();
                             sb.append(separator);
                             sb.append("Caught ");
                             sb.append(c.getCondition().typeOf().writeToString());
@@ -541,7 +541,7 @@
     private static String banner()
     {
         final String sep = System.getProperty("line.separator");
-        FastStringBuffer sb = new FastStringBuffer("Armed Bear Common Lisp ");
+        StringBuilder sb = new StringBuilder("Armed Bear Common Lisp ");
         sb.append(Version.getVersion());
         if (build != null) {
             sb.append(" (built ");

Modified: trunk/abcl/src/org/armedbear/lisp/Java.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Java.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Java.java	Mon Feb  8 03:05:15 2010
@@ -323,7 +323,7 @@
                 throw new NoSuchMethodException();
             }
             catch (NoSuchMethodException e) {
-                FastStringBuffer sb = new FastStringBuffer("No such method: ");
+                StringBuilder sb = new StringBuilder("No such method: ");
                 sb.append(c.getName());
                 sb.append('.');
                 sb.append(methodName);

Modified: trunk/abcl/src/org/armedbear/lisp/JavaClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JavaClass.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/JavaClass.java	Mon Feb  8 03:05:15 2010
@@ -96,7 +96,7 @@
 	}
 
 	public String writeToString() {
-		FastStringBuffer sb = new FastStringBuffer("#<JAVA-CLASS ");
+		StringBuilder sb = new StringBuilder("#<JAVA-CLASS ");
 		sb.append(javaClass.getCanonicalName());
 		sb.append('>');
 		return sb.toString();

Modified: trunk/abcl/src/org/armedbear/lisp/JavaObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JavaObject.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/JavaObject.java	Mon Feb  8 03:05:15 2010
@@ -303,8 +303,8 @@
 	final String s;
 	if(obj != null) {
 	    Class<?> c = obj.getClass();
-	    FastStringBuffer sb
-		= new FastStringBuffer(c.isArray() ? "jarray" : c.getName());
+	    StringBuilder sb
+		= new StringBuilder(c.isArray() ? "jarray" : c.getName());
 	    sb.append(' ');
 	    String ts = obj.toString();
 	    if(ts.length() > 32) { //random value, should be chosen sensibly
@@ -436,8 +436,8 @@
     public static String describeJavaObject(final JavaObject javaObject)
 	{
 	final Object obj = javaObject.getObject();
-	final FastStringBuffer sb =
-	    new FastStringBuffer(javaObject.writeToString());
+	final StringBuilder sb =
+	    new StringBuilder(javaObject.writeToString());
 	sb.append(" is an object of type ");
 	sb.append(Symbol.JAVA_OBJECT.writeToString());
 	sb.append(".");

Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java	Mon Feb  8 03:05:15 2010
@@ -1063,7 +1063,7 @@
   public static final Symbol gensym(String prefix, LispThread thread)
 
   {
-    FastStringBuffer sb = new FastStringBuffer(prefix);
+    StringBuilder sb = new StringBuilder(prefix);
     SpecialBinding binding = thread.getSpecialBinding(Symbol.GENSYM_COUNTER);
     final LispObject oldValue;
     if (binding != null) {
@@ -1676,7 +1676,7 @@
   {
     if (start < 0 || end < 0 || start > end || end > length)
       {
-        FastStringBuffer sb = new FastStringBuffer("The bounding indices ");
+        StringBuilder sb = new StringBuilder("The bounding indices ");
         sb.append(start);
         sb.append(" and ");
         sb.append(end);

Modified: trunk/abcl/src/org/armedbear/lisp/LispCharacter.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispCharacter.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispCharacter.java	Mon Feb  8 03:05:15 2010
@@ -96,7 +96,7 @@
   @Override
   public LispObject getDescription()
   {
-    FastStringBuffer sb = new FastStringBuffer("character #\\");
+    StringBuilder sb = new StringBuilder("character #\\");
     sb.append(value);
     sb.append(" char-code #x");
     sb.append(Integer.toHexString(value));
@@ -240,7 +240,7 @@
     // false."
     boolean printEscape =
       printReadably || (Symbol.PRINT_ESCAPE.symbolValue(thread) != NIL);
-    FastStringBuffer sb = new FastStringBuffer();
+    StringBuilder sb = new StringBuilder();
     if (printEscape)
       {
         sb.append("#\\");

Modified: trunk/abcl/src/org/armedbear/lisp/LispClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispClass.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispClass.java	Mon Feb  8 03:05:15 2010
@@ -77,8 +77,8 @@
       return c;
     if (errorp)
       {
-        FastStringBuffer sb =
-          new FastStringBuffer("There is no class named ");
+        StringBuilder sb =
+          new StringBuilder("There is no class named ");
         sb.append(name.writeToString());
         sb.append('.');
         return error(new LispError(sb.toString()));

Modified: trunk/abcl/src/org/armedbear/lisp/LispObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispObject.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispObject.java	Mon Feb  8 03:05:15 2010
@@ -64,7 +64,7 @@
 
   public LispObject getDescription()
   {
-    FastStringBuffer sb = new FastStringBuffer("An object of type ");
+    StringBuilder sb = new StringBuilder("An object of type ");
     sb.append(typeOf().writeToString());
     sb.append(" at #x");
     sb.append(Integer.toHexString(System.identityHashCode(this)).toUpperCase());
@@ -682,7 +682,7 @@
 
   public String unreadableString(String s, boolean identity)
   {
-    FastStringBuffer sb = new FastStringBuffer("#<");
+    StringBuilder sb = new StringBuilder("#<");
     sb.append(s);
     if (identity) {
       sb.append(" {");

Modified: trunk/abcl/src/org/armedbear/lisp/LispReader.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispReader.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispReader.java	Mon Feb  8 03:05:15 2010
@@ -74,7 +74,7 @@
         {
             final LispThread thread = LispThread.currentThread();
             final Readtable rt = (Readtable) Symbol.CURRENT_READTABLE.symbolValue(thread);
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
             try 
               {
                 while (true) {
@@ -222,7 +222,7 @@
             final LispThread thread = LispThread.currentThread();
             final Readtable rt = (Readtable) Symbol.CURRENT_READTABLE.symbolValue(thread);
             final boolean suppress = Symbol.READ_SUPPRESS.symbolValue(thread) != NIL;
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
             try 
               {
                 while (true) {
@@ -467,7 +467,7 @@
         public LispObject execute(Stream stream, char c, int n)
 
         {
-            FastStringBuffer sb = new FastStringBuffer("Illegal # macro character: #\\");
+            StringBuilder sb = new StringBuilder("Illegal # macro character: #\\");
             String s = LispCharacter.charToName(c);
             if (s != null)
                 sb.append(s);

Modified: trunk/abcl/src/org/armedbear/lisp/Load.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Load.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Load.java	Mon Feb  8 03:05:15 2010
@@ -187,8 +187,8 @@
                                       verbose, print, false, returnLastResult);
         }
         catch (FaslVersionMismatch e) {
-            FastStringBuffer sb =
-                new FastStringBuffer("Incorrect fasl version: ");
+            StringBuilder sb =
+                new StringBuilder("Incorrect fasl version: ");
             sb.append(truename);
             return error(new SimpleError(sb.toString()));
         }
@@ -301,8 +301,8 @@
                 return loadFileFromStream(pathname, truename, stream,
                                           verbose, print, auto);
             } catch (FaslVersionMismatch e) {
-                FastStringBuffer sb =
-                    new FastStringBuffer("; Incorrect fasl version: ");
+                StringBuilder sb =
+                    new StringBuilder("; Incorrect fasl version: ");
                 sb.append(truename);
                 System.err.println(sb.toString());
             } finally {
@@ -483,7 +483,7 @@
 
     public static String getLoadVerbosePrefix(int loadDepth)
     {
-        FastStringBuffer sb = new FastStringBuffer(";");
+        StringBuilder sb = new StringBuilder(";");
         for (int i = loadDepth - 1; i-- > 0;)
             sb.append(' ');
         return sb.toString();

Modified: trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LogicalPathname.java	Mon Feb  8 03:05:15 2010
@@ -203,7 +203,7 @@
     @Override
     protected String getDirectoryNamestring()
     {
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         // "If a pathname is converted to a namestring, the symbols NIL and
         // :UNSPECIFIC cause the field to be treated as if it were empty. That
         // is, both NIL and :UNSPECIFIC cause the component not to appear in
@@ -244,7 +244,7 @@
         final LispThread thread = LispThread.currentThread();
         boolean printReadably = (Symbol.PRINT_READABLY.symbolValue(thread) != NIL);
         boolean printEscape = (Symbol.PRINT_ESCAPE.symbolValue(thread) != NIL);
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (printReadably || printEscape)
             sb.append("#P\"");
         sb.append(host.getStringValue());

Modified: trunk/abcl/src/org/armedbear/lisp/Package.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Package.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Package.java	Mon Feb  8 03:05:15 2010
@@ -88,7 +88,7 @@
     public LispObject getDescription()
     {
         if (name != null) {
-            FastStringBuffer sb = new FastStringBuffer("The ");
+            StringBuilder sb = new StringBuilder("The ");
             sb.append(name);
             sb.append(" package");
             return new SimpleString(sb);
@@ -405,8 +405,8 @@
                         if (sym == null)
                             sym = s;
                         else if (sym != s) {
-                            FastStringBuffer sb =
-                                new FastStringBuffer("Uninterning the symbol ");
+                            StringBuilder sb =
+                                new StringBuilder("Uninterning the symbol ");
                             sb.append(symbol.getQualifiedName());
                             sb.append(" causes a name conflict between ");
                             sb.append(sym.getQualifiedName());
@@ -442,7 +442,7 @@
             return; // Nothing to do.
         Symbol sym = findAccessibleSymbol(symbol.name);
         if (sym != null && sym != symbol) {
-            FastStringBuffer sb = new FastStringBuffer("The symbol ");
+            StringBuilder sb = new StringBuilder("The symbol ");
             sb.append(sym.getQualifiedName());
             sb.append(" is already accessible in package ");
             sb.append(name);
@@ -461,7 +461,7 @@
         if (symbol.getPackage() != this) {
             Symbol sym = findAccessibleSymbol(symbol.name);
             if (sym != symbol) {
-                FastStringBuffer sb = new FastStringBuffer("The symbol ");
+                StringBuilder sb = new StringBuilder("The symbol ");
                 sb.append(symbol.getQualifiedName());
                 sb.append(" is not accessible in package ");
                 sb.append(name);
@@ -482,7 +482,7 @@
                             pkg.shadowingSymbols.get(symbolName) == sym) {
                             // OK.
                         } else {
-                            FastStringBuffer sb = new FastStringBuffer("The symbol ");
+                            StringBuilder sb = new StringBuilder("The symbol ");
                             sb.append(sym.getQualifiedName());
                             sb.append(" is already accessible in package ");
                             sb.append(pkg.getName());
@@ -501,7 +501,7 @@
         if (externalSymbols.get(symbol.name) == symbol)
             // Symbol is already exported; there's nothing to do.
             return;
-        FastStringBuffer sb = new FastStringBuffer("The symbol ");
+        StringBuilder sb = new StringBuilder("The symbol ");
         sb.append(symbol.getQualifiedName());
         sb.append(" is not accessible in package ");
         sb.append(name);
@@ -528,7 +528,7 @@
                     usedPackages = usedPackages.cdr();
                 }
             }
-            FastStringBuffer sb = new FastStringBuffer("The symbol ");
+            StringBuilder sb = new StringBuilder("The symbol ");
             sb.append(symbol.getQualifiedName());
             sb.append(" is not accessible in package ");
             sb.append(name);
@@ -825,7 +825,7 @@
     public String writeToString()
     {
         if (_PRINT_FASL_.symbolValue() != NIL && name != null) {
-            FastStringBuffer sb = new FastStringBuffer("#.(FIND-PACKAGE \"");
+            StringBuilder sb = new StringBuilder("#.(FIND-PACKAGE \"");
             sb.append(name);
             sb.append("\")");
             return sb.toString();
@@ -836,7 +836,7 @@
     @Override
     public String toString() {
          if (name != null) {
-            FastStringBuffer sb = new FastStringBuffer("#<PACKAGE \"");
+            StringBuilder sb = new StringBuilder("#<PACKAGE \"");
             sb.append(name);
             sb.append("\">");
             return sb.toString();

Modified: trunk/abcl/src/org/armedbear/lisp/Pathname.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Pathname.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Pathname.java	Mon Feb  8 03:05:15 2010
@@ -470,7 +470,7 @@
         if (directory instanceof AbstractString) {
             Debug.assertTrue(false);
         }
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         // "If a pathname is converted to a namestring, the symbols NIL and
         // :UNSPECIFIC cause the field to be treated as if it were empty. That
         // is, both NIL and :UNSPECIFIC cause the component not to appear in
@@ -498,7 +498,7 @@
                 sb.append("!/");
                 i = 1;
             }
-            FastStringBuffer prefix = new FastStringBuffer();
+            StringBuilder prefix = new StringBuilder();
             for (; i < jars.length; i++) {
                 prefix.append("jar:");
                 if (i == 0) {
@@ -568,7 +568,7 @@
 
     protected String getDirectoryNamestring() {
         validateDirectory(true);
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         // "If a pathname is converted to a namestring, the symbols NIL and
         // :UNSPECIFIC cause the field to be treated as if it were empty. That
         // is, both NIL and :UNSPECIFIC cause the component not to appear in
@@ -733,7 +733,7 @@
         } else {
             useNamestring = false;
         }
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         if (useNamestring) {
             if (printReadably || printEscape) {
                 sb.append("#P\"");
@@ -1182,7 +1182,7 @@
                 LispObject second = temp.car();
                 if (second == Keyword.UP || second == Keyword.BACK) {
                     if (signalError) {
-                        FastStringBuffer sb = new FastStringBuffer();
+                        StringBuilder sb = new StringBuilder();
                         sb.append(first.writeToString());
                         sb.append(" may not be followed immediately by ");
                         sb.append(second.writeToString());
@@ -1683,7 +1683,7 @@
         }
         error:
         if (errorIfDoesNotExist) {
-            FastStringBuffer sb = new FastStringBuffer("The file ");
+            StringBuilder sb = new StringBuilder("The file ");
             sb.append(pathname.writeToString());
             sb.append(" does not exist.");
             return error(new FileError(sb.toString(), pathname));
@@ -1957,7 +1957,7 @@
           @Override
           public LispObject execute(LispObject arg) {
               Pathname p = coerceToPathname(arg);
-              FastStringBuffer sb = new FastStringBuffer();
+              StringBuilder sb = new StringBuilder();
               if (p.name instanceof AbstractString) {
                   sb.append(p.name.getStringValue());
               } else if (p.name == Keyword.WILD) {

Modified: trunk/abcl/src/org/armedbear/lisp/Primitives.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Primitives.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Primitives.java	Mon Feb  8 03:05:15 2010
@@ -2178,8 +2178,8 @@
         int rank = array.getRank();
         if (rank != args.length - 1)
           {
-            FastStringBuffer sb =
-              new FastStringBuffer("ARRAY-IN-BOUNDS-P: ");
+            StringBuilder sb =
+              new StringBuilder("ARRAY-IN-BOUNDS-P: ");
             sb.append("wrong number of subscripts (");
             sb.append(args.length - 1);
             sb.append(") for array of rank ");
@@ -2235,8 +2235,8 @@
         array = checkArray( arg);
         if (array.getRank() == 0)
           return array.AREF(0);
-        FastStringBuffer sb =
-          new FastStringBuffer("Wrong number of subscripts (0) for array of rank ");
+        StringBuilder sb =
+          new StringBuilder("Wrong number of subscripts (0) for array of rank ");
         sb.append(array.getRank());
         sb.append('.');
         return error(new ProgramError(sb.toString()));
@@ -2945,7 +2945,7 @@
             int n = ((Fixnum)arg).value;
             if (n >= 0)
               {
-                FastStringBuffer sb = new FastStringBuffer('G');
+                StringBuilder sb = new StringBuilder("G");
                 sb.append(n); // Decimal representation.
                 return new Symbol(new SimpleString(sb));
               }
@@ -2955,7 +2955,7 @@
             BigInteger n = ((Bignum)arg).value;
             if (n.signum() >= 0)
               {
-                FastStringBuffer sb = new FastStringBuffer('G');
+                StringBuilder sb = new StringBuilder("G");
                 sb.append(n.toString()); // Decimal representation.
                 return new Symbol(new SimpleString(sb));
               }
@@ -4109,7 +4109,7 @@
         final int start = Fixnum.getValue(second);
         if (start < 0)
           {
-            FastStringBuffer sb = new FastStringBuffer("Bad start index (");
+            StringBuilder sb = new StringBuilder("Bad start index (");
             sb.append(start);
             sb.append(") for SUBSEQ.");
             error(new TypeError(sb.toString()));
@@ -4131,7 +4131,7 @@
         final int start = Fixnum.getValue(second);
         if (start < 0)
           {
-            FastStringBuffer sb = new FastStringBuffer("Bad start index (");
+            StringBuilder sb = new StringBuilder("Bad start index (");
             sb.append(start);
             sb.append(").");
             error(new TypeError(sb.toString()));
@@ -4142,7 +4142,7 @@
             end = Fixnum.getValue(third);
             if (start > end)
               {
-                FastStringBuffer sb = new FastStringBuffer("Start index (");
+                StringBuilder sb = new StringBuilder("Start index (");
                 sb.append(start);
                 sb.append(") is greater than end index (");
                 sb.append(end);

Modified: trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/PrintNotReadable.java	Mon Feb  8 03:05:15 2010
@@ -81,7 +81,7 @@
     @Override
     public String getMessage()
     {
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         LispObject object = UNBOUND_VALUE;
         object = getInstanceSlotValue(Symbol.OBJECT);
         if (object != UNBOUND_VALUE) {

Modified: trunk/abcl/src/org/armedbear/lisp/Readtable.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Readtable.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Readtable.java	Mon Feb  8 03:05:15 2010
@@ -237,7 +237,7 @@
     if (isInvalid(c))
       {
         String name = LispCharacter.charToName(c);
-        FastStringBuffer sb = new FastStringBuffer("Invalid character");
+        StringBuilder sb = new StringBuilder("Invalid character");
         if (name != null)
           {
             sb.append(" #\\");

Modified: trunk/abcl/src/org/armedbear/lisp/Return.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Return.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Return.java	Mon Feb  8 03:05:15 2010
@@ -71,7 +71,7 @@
     @Override
     public LispObject getCondition()
     {
-        FastStringBuffer sb = new FastStringBuffer("No block named ");
+        StringBuilder sb = new StringBuilder("No block named ");
         sb.append(tag.writeToString());
         sb.append(" is currently visible.");
         return new ControlError(sb.toString());

Modified: trunk/abcl/src/org/armedbear/lisp/ShellCommand.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/ShellCommand.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/ShellCommand.java	Mon Feb  8 03:05:15 2010
@@ -85,7 +85,7 @@
             if (command != null) {
                 if (Utilities.isPlatformUnix) {
                     if (directory != null) {
-                        FastStringBuffer sb = new FastStringBuffer("\\cd \"");
+                        StringBuilder sb = new StringBuilder("\\cd \"");
                         sb.append(directory);
                         sb.append("\" && ");
                         sb.append(command);
@@ -100,7 +100,7 @@
                     list.add("cmd.exe");
                     list.add("/c");
                     if (directory != null) {
-                        FastStringBuffer sb = new FastStringBuffer("cd /d \"");
+                        StringBuilder sb = new StringBuilder("cd /d \"");
                         sb.append(directory);
                         sb.append("\" && ");
                         sb.append(command);

Modified: trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/SimpleArray_T.java	Mon Feb  8 03:05:15 2010
@@ -253,7 +253,7 @@
     final int rank = dimv.length;
     if (rank != subscripts.length)
       {
-        FastStringBuffer sb = new FastStringBuffer("Wrong number of subscripts (");
+        StringBuilder sb = new StringBuilder("Wrong number of subscripts (");
         sb.append(subscripts.length);
         sb.append(") for array of rank ");
         sb.append(rank);
@@ -270,7 +270,7 @@
         int n = subscripts[i];
         if (n < 0 || n >= dim)
           {
-            FastStringBuffer sb = new FastStringBuffer("Invalid index ");
+            StringBuilder sb = new StringBuilder("Invalid index ");
             sb.append(n);
             sb.append(" for array ");
             sb.append(this);

Modified: trunk/abcl/src/org/armedbear/lisp/SimpleString.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SimpleString.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/SimpleString.java	Mon Feb  8 03:05:15 2010
@@ -72,9 +72,9 @@
         sb.getChars(0, capacity, chars, 0);
     }
 
-    public SimpleString(FastStringBuffer sb)
+    public SimpleString(StringBuilder sb)
     {
-        chars = sb.toCharArray();
+        chars = sb.toString().toCharArray();
         capacity = chars.length;
     }
 
@@ -111,7 +111,7 @@
     @Override
     public LispObject getDescription()
     {
-        FastStringBuffer sb = new FastStringBuffer("A simple-string (");
+        StringBuilder sb = new StringBuilder("A simple-string (");
         sb.append(capacity);
         sb.append(") \"");
         sb.append(chars);

Modified: trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/SlotDefinition.java	Mon Feb  8 03:05:15 2010
@@ -88,8 +88,8 @@
   @Override
   public String writeToString()
   {
-    FastStringBuffer sb =
-      new FastStringBuffer(Symbol.SLOT_DEFINITION.writeToString());
+    StringBuilder sb =
+      new StringBuilder(Symbol.SLOT_DEFINITION.writeToString());
     LispObject name = slots[SlotDefinitionClass.SLOT_INDEX_NAME];
     if (name != null && name != NIL)
       {

Modified: trunk/abcl/src/org/armedbear/lisp/StandardClass.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StandardClass.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/StandardClass.java	Mon Feb  8 03:05:15 2010
@@ -87,8 +87,8 @@
   @Override
   public String writeToString()
   {
-    FastStringBuffer sb =
-      new FastStringBuffer(Symbol.STANDARD_CLASS.writeToString());
+    StringBuilder sb =
+      new StringBuilder(Symbol.STANDARD_CLASS.writeToString());
     if (symbol != null)
       {
         sb.append(' ');

Modified: trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/StandardGenericFunction.java	Mon Feb  8 03:05:15 2010
@@ -208,7 +208,7 @@
     LispObject name = getGenericFunctionName();
     if (name != null)
       {
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         sb.append(getLispClass().getSymbol().writeToString());
         sb.append(' ');
         sb.append(name.writeToString());

Modified: trunk/abcl/src/org/armedbear/lisp/StandardMethod.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StandardMethod.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/StandardMethod.java	Mon Feb  8 03:05:15 2010
@@ -155,7 +155,7 @@
           ((StandardGenericFunction)genericFunction).getGenericFunctionName();
         if (name != null)
           {
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
             sb.append(getLispClass().getSymbol().writeToString());
             sb.append(' ');
             sb.append(name.writeToString());

Modified: trunk/abcl/src/org/armedbear/lisp/Stream.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Stream.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Stream.java	Mon Feb  8 03:05:15 2010
@@ -553,13 +553,13 @@
     public LispObject readSymbol() {
         final Readtable rt =
             (Readtable) Symbol.CURRENT_READTABLE.symbolValue(LispThread.currentThread());
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         _readToken(sb, rt);
         return new Symbol(sb.toString());
     }
 
     public LispObject readSymbol(Readtable rt) {
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         _readToken(sb, rt);
         return new Symbol(sb.toString());
     }
@@ -784,7 +784,7 @@
             if (n < 0)
                 return error(new EndOfFile(this));
             char c = (char) n; // ### BUG: Codepoint conversion
-            FastStringBuffer sb = new FastStringBuffer(c);
+            StringBuilder sb = new StringBuilder(String.valueOf(c));
             while (true) {
                 n = _readChar();
                 if (n < 0)
@@ -887,7 +887,7 @@
         if (obj instanceof Cons && obj.length() == 2)
             return Complex.getInstance(obj.car(), obj.cadr());
         // Error.
-        FastStringBuffer sb = new FastStringBuffer("Invalid complex number format");
+        StringBuilder sb = new StringBuilder("Invalid complex number format");
         if (this instanceof FileStream) {
             Pathname p = ((FileStream)this).getPathname();
             if (p != null) {
@@ -914,7 +914,7 @@
         if (obj instanceof Cons && obj.length() == 2)
             return Complex.getInstance(obj.car(), obj.cadr());
         // Error.
-        FastStringBuffer sb = new FastStringBuffer("Invalid complex number format");
+        StringBuilder sb = new StringBuilder("Invalid complex number format");
         if (this instanceof FileStream) {
             Pathname p = ((FileStream)this).getPathname();
             if (p != null) {
@@ -934,7 +934,7 @@
     }
 
     private String readMultipleEscape(Readtable rt) {
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         try {
             while (true) {
                 int n = _readChar();
@@ -994,7 +994,7 @@
     private final LispObject readToken(char c, Readtable rt)
 
     {
-        FastStringBuffer sb = new FastStringBuffer(c);
+        StringBuilder sb = new StringBuilder(String.valueOf(c));
         final LispThread thread = LispThread.currentThread();
         BitSet flags = _readToken(sb, rt);
         if (Symbol.READ_SUPPRESS.symbolValue(thread) != NIL)
@@ -1085,7 +1085,7 @@
         return ((Package)Symbol._PACKAGE_.symbolValue(thread)).intern(new SimpleString(token));
     }
 
-    private final BitSet _readToken(FastStringBuffer sb, Readtable rt)
+    private final BitSet _readToken(StringBuilder sb, Readtable rt)
 
     {
         BitSet flags = null;
@@ -1198,7 +1198,7 @@
                 state = LOWER;
             }
         }
-        FastStringBuffer sb = new FastStringBuffer(limit);
+        StringBuilder sb = new StringBuilder(limit);
         for (int i = 0; i < limit; i++) {
             char c = s.charAt(i);
             if (flags != null && flags.get(i)) // Escaped.
@@ -1311,7 +1311,7 @@
     {
         if (length == 0)
             return null;
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         int i = 0;
         boolean maybe = false;
         char marker = 0;
@@ -1373,7 +1373,7 @@
     }
 
     public LispObject readRadix(int radix) {
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         final LispThread thread = LispThread.currentThread();
         final Readtable rt =
             (Readtable) Symbol.CURRENT_READTABLE.symbolValue(thread);
@@ -1402,7 +1402,7 @@
     }
 
     public LispObject faslReadRadix(int radix) {
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         final LispThread thread = LispThread.currentThread();
         final Readtable rt = FaslReadtable.getInstance();
         boolean escaped = (_readToken(sb, rt) != null);
@@ -1471,7 +1471,7 @@
 
     {
         final LispThread thread = LispThread.currentThread();
-        FastStringBuffer sb = new FastStringBuffer();
+        StringBuilder sb = new StringBuilder();
         try {
             while (true) {
                 int n = _readChar();

Modified: trunk/abcl/src/org/armedbear/lisp/StringFunctions.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StringFunctions.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/StringFunctions.java	Mon Feb  8 03:05:15 2010
@@ -584,7 +584,7 @@
                 return error(new TypeError("Invalid end position " + start + "."));
             if (start > end)
                 return error(new TypeError("Start (" + start + ") is greater than end (" + end + ")."));
-            FastStringBuffer sb = new FastStringBuffer(length);
+            StringBuilder sb = new StringBuilder(length);
             char[] array = s.getStringChars();
             int i;
             for (i = 0; i < start; i++)
@@ -619,7 +619,7 @@
                 return error(new TypeError("Invalid end position " + start + "."));
             if (start > end)
                 return error(new TypeError("Start (" + start + ") is greater than end (" + end + ")."));
-            FastStringBuffer sb = new FastStringBuffer(length);
+            StringBuilder sb = new StringBuilder(length);
             char[] array = s.getStringChars();
             int i;
             for (i = 0; i < start; i++)
@@ -655,7 +655,7 @@
                 return error(new TypeError("Invalid end position " + start + "."));
             if (start > end)
                 return error(new TypeError("Start (" + start + ") is greater than end (" + end + ")."));
-            FastStringBuffer sb = new FastStringBuffer(length);
+            StringBuilder sb = new StringBuilder(length);
             char[] array = s.getStringChars();
             boolean lastCharWasAlphanumeric = false;
             int i;
@@ -813,7 +813,7 @@
         {
             final int n = Fixnum.getValue(size);
             if (n < 0 || n >= ARRAY_DIMENSION_MAX) {
-                FastStringBuffer sb = new FastStringBuffer();
+                StringBuilder sb = new StringBuilder();
                 sb.append("The size specified for this string (");
                 sb.append(n);
                 sb.append(')');

Modified: trunk/abcl/src/org/armedbear/lisp/StructureObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/StructureObject.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/StructureObject.java	Mon Feb  8 03:05:15 2010
@@ -377,7 +377,7 @@
 
   private LispObject badIndex(int n)
   {
-    FastStringBuffer sb = new FastStringBuffer("Invalid slot index ");
+    StringBuilder sb = new StringBuilder("Invalid slot index ");
     sb.append(Fixnum.getInstance(n).writeToString());
     sb.append(" for ");
     sb.append(writeToString());
@@ -431,7 +431,7 @@
         int currentLevel = Fixnum.getValue(currentPrintLevel);
         if (currentLevel >= maxLevel && slots.length > 0)
           return "#";
-        FastStringBuffer sb = new FastStringBuffer("#S(");
+        StringBuilder sb = new StringBuilder("#S(");
         sb.append(structureClass.getSymbol().writeToString());
         if (currentLevel < maxLevel)
           {

Modified: trunk/abcl/src/org/armedbear/lisp/Symbol.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Symbol.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Symbol.java	Mon Feb  8 03:05:15 2010
@@ -118,7 +118,7 @@
     thread.bindSpecial(Symbol.PRINT_ESCAPE, NIL);
     try
       {
-        FastStringBuffer sb = new FastStringBuffer("The symbol ");
+        StringBuilder sb = new StringBuilder("The symbol ");
         sb.append(name.writeToString());
         sb.append(" at #x");
         sb.append(Integer.toHexString(System.identityHashCode(this)).toUpperCase());
@@ -257,7 +257,7 @@
       return("#:".concat(n));
     if (pkg == PACKAGE_KEYWORD)
       return ":".concat(n);
-    FastStringBuffer sb = new FastStringBuffer(((Package)pkg).getName());
+    StringBuilder sb = new StringBuilder(((Package)pkg).getName());
     if (((Package)pkg).findExternalSymbol(name) != null)
       sb.append(':');
     else
@@ -444,7 +444,7 @@
         if (readtableCase != Keyword.UPCASE ||
             printCase != Keyword.UPCASE)
           {
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
             if (pkg == PACKAGE_KEYWORD)
               {
                 sb.append(':');
@@ -572,7 +572,7 @@
             packageName = invert(packageName);
           }
       }
-    FastStringBuffer sb = new FastStringBuffer(packageName);
+    StringBuilder sb = new StringBuilder(packageName);
     if (((Package)pkg).findExternalSymbol(name) != null
         && DOUBLE_COLON_PACKAGE_SEPARATORS.symbolValue(thread) == NIL)
       sb.append(':');
@@ -607,7 +607,7 @@
             state = LOWER;
           }
       }
-    FastStringBuffer sb = new FastStringBuffer(limit);
+    StringBuilder sb = new StringBuilder(limit);
     for (int i = 0; i < limit; i++)
       {
         char c = s.charAt(i);
@@ -695,7 +695,7 @@
 
   private static final String multipleEscape(String s)
   {
-    FastStringBuffer sb = new FastStringBuffer("|");
+    StringBuilder sb = new StringBuilder("|");
     final int limit = s.length();
     for (int i = 0; i < limit; i++)
       {
@@ -713,7 +713,7 @@
     if (readtableCase == Keyword.INVERT || readtableCase == Keyword.PRESERVE)
       return s;
     final int limit = s.length();
-    FastStringBuffer sb = new FastStringBuffer(limit);
+    StringBuilder sb = new StringBuilder(limit);
     boolean lastCharWasAlphanumeric = false;
     for (int i = 0; i < limit; i++)
       {

Modified: trunk/abcl/src/org/armedbear/lisp/Time.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Time.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Time.java	Mon Feb  8 03:05:15 2010
@@ -62,7 +62,7 @@
             Stream out =
               checkCharacterOutputStream(Symbol.TRACE_OUTPUT.symbolValue());
             out.freshLine();
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
             sb.append(String.valueOf((float)realElapsed / 1000));
             sb.append(" seconds real time");
             sb.append(System.getProperty("line.separator"));

Modified: trunk/abcl/src/org/armedbear/lisp/TypeError.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/TypeError.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/TypeError.java	Mon Feb  8 03:05:15 2010
@@ -138,7 +138,7 @@
                 return s;
             final LispObject datum = getDatum();
             final LispObject expectedType = getExpectedType();
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
             String name = datum != null ? datum.writeToString() : null;
             String type = null;
             if (expectedType != null)

Modified: trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/UnboundSlot.java	Mon Feb  8 03:05:15 2010
@@ -75,7 +75,7 @@
         final SpecialBindingsMark mark = thread.markSpecialBindings();
         thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
         try {
-            FastStringBuffer sb = new FastStringBuffer("The slot ");
+            StringBuilder sb = new StringBuilder("The slot ");
             sb.append(getCellName().writeToString());
             sb.append(" is unbound in the object ");
             sb.append(getInstance().writeToString());

Modified: trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/UndefinedFunction.java	Mon Feb  8 03:05:15 2010
@@ -72,7 +72,7 @@
   @Override
   public String getMessage()
   {
-    FastStringBuffer sb = new FastStringBuffer("The function ");
+    StringBuilder sb = new StringBuilder("The function ");
     sb.append(getCellName().writeToString());
     sb.append(" is undefined.");
     return sb.toString();

Modified: trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java	Mon Feb  8 03:05:15 2010
@@ -71,8 +71,8 @@
 	if(message != null) {
 	    return message;
 	}
-        FastStringBuffer sb =
-            new FastStringBuffer("Wrong number of arguments");
+        StringBuilder sb =
+            new StringBuilder("Wrong number of arguments");
         LispObject lambdaName = operator.getLambdaName();
         if (lambdaName != null && lambdaName != NIL) {
             sb.append(" for ");

Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/clos.lisp	(original)
+++ trunk/abcl/src/org/armedbear/lisp/clos.lisp	Mon Feb  8 03:05:15 2010
@@ -537,14 +537,7 @@
 (defun canonical-slot-name (canonical-slot)
   (getf canonical-slot :name))
 
-(defun ensure-class (name &rest all-keys
-                     &key (metaclass 'standard-class) &allow-other-keys)
-
-  ;; Don't pass METACLASS on to the initialization routines
-  ;; This only works because we *know* ABCL conses up new &rest lists
-  ;; every time; otherwise, modifying the argument list is discouraged by the spec
-  (remf all-keys :metaclass)
-
+(defun ensure-class (name &rest all-keys &allow-other-keys)
   ;; Check for duplicate slots.
   (let ((slots (getf all-keys :direct-slots)))
     (dolist (s1 slots)
@@ -589,12 +582,8 @@
                   (apply #'std-after-initialization-for-classes old-class all-keys)
                   old-class)))
           (t
-           (let ((class (apply (if (eq metaclass 'standard-class)
-                                   #'make-instance-standard-class
-                                   #'make-instance)
-                               (or (when (symbolp metaclass)
-                                     (find-class metaclass))
-                                   metaclass)
+           (let ((class (apply #'make-instance-standard-class
+                               (find-class 'standard-class)
                                :name name all-keys)))
              (%set-find-class name class)
              class)))))

Modified: trunk/abcl/src/org/armedbear/lisp/delete_file.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/delete_file.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/delete_file.java	Mon Feb  8 03:05:15 2010
@@ -77,7 +77,7 @@
                 Thread.yield();
             }
             Pathname truename = new Pathname(file.getAbsolutePath());
-            FastStringBuffer sb = new FastStringBuffer("Unable to delete ");
+            StringBuilder sb = new StringBuilder("Unable to delete ");
             sb.append(file.isDirectory() ? "directory " : "file ");
             sb.append(truename.writeToString());
             sb.append('.');

Modified: trunk/abcl/src/org/armedbear/lisp/make_array.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/make_array.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/make_array.java	Mon Feb  8 03:05:15 2010
@@ -126,7 +126,7 @@
         final int size = dimv[0];
         if (size < 0 || size >= ARRAY_DIMENSION_MAX)
           {
-            FastStringBuffer sb = new FastStringBuffer();
+            StringBuilder sb = new StringBuilder();
             sb.append("The size specified for this array (");
             sb.append(size);
             sb.append(')');




More information about the armedbear-cvs mailing list