[armedbear-cvs] r12305 - in branches/fast-boot-preloading/abcl: examples/abcl/interface_implementation_in_lisp examples/abcl/java_exception_in_lisp examples/abcl/javacall_from_lisp examples/abcl/lispcall_from_java_simple examples/abcl/lispcall_from_java_with_params_and_return src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Fri Dec 25 14:27:38 UTC 2009
Author: ehuelsmann
Date: Fri Dec 25 09:27:34 2009
New Revision: 12305
Log:
Backport r12298: review of "catch (Throwable".
Note: Lisp.java redone because of merge conflicts.
Modified:
branches/fast-boot-preloading/abcl/examples/abcl/interface_implementation_in_lisp/Main.java
branches/fast-boot-preloading/abcl/examples/abcl/java_exception_in_lisp/Main.java
branches/fast-boot-preloading/abcl/examples/abcl/javacall_from_lisp/Main.java
branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_simple/Main.java
branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_simple/MainAlternative.java
branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_with_params_and_return/Main.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/AbstractArray.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/AbstractVector.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/BuiltInClass.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Condition.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Go.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Interpreter.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Java.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/JavaClassLoader.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Layout.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Lisp.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/LispStackFrame.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/LispThread.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Load.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/MathFunctions.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Package.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Pathname.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/PrintNotReadable.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/RandomState.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Return.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/RuntimeClass.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/ShellCommand.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SimpleTypeError.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Site.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SiteName.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlimeInputStream.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlotClass.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlotDefinition.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Symbol.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SymbolHashTable.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Throw.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/TypeError.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/UnboundVariable.java
branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java
Modified: branches/fast-boot-preloading/abcl/examples/abcl/interface_implementation_in_lisp/Main.java
==============================================================================
--- branches/fast-boot-preloading/abcl/examples/abcl/interface_implementation_in_lisp/Main.java (original)
+++ branches/fast-boot-preloading/abcl/examples/abcl/interface_implementation_in_lisp/Main.java Fri Dec 25 09:27:34 2009
@@ -63,7 +63,7 @@
}
catch (Throwable t)
{
- System.out.println("abcl exception!");
+ System.out.println("exception!");
t.printStackTrace();
}
}
Modified: branches/fast-boot-preloading/abcl/examples/abcl/java_exception_in_lisp/Main.java
==============================================================================
--- branches/fast-boot-preloading/abcl/examples/abcl/java_exception_in_lisp/Main.java (original)
+++ branches/fast-boot-preloading/abcl/examples/abcl/java_exception_in_lisp/Main.java Fri Dec 25 09:27:34 2009
@@ -52,7 +52,7 @@
}
catch (Throwable t)
{
- System.out.println("abcl exception!");
+ System.out.println("exception!");
t.printStackTrace();
}
}
Modified: branches/fast-boot-preloading/abcl/examples/abcl/javacall_from_lisp/Main.java
==============================================================================
--- branches/fast-boot-preloading/abcl/examples/abcl/javacall_from_lisp/Main.java (original)
+++ branches/fast-boot-preloading/abcl/examples/abcl/javacall_from_lisp/Main.java Fri Dec 25 09:27:34 2009
@@ -52,7 +52,7 @@
}
catch (Throwable t)
{
- System.out.println("abcl exception!");
+ System.out.println("exception!");
t.printStackTrace();
}
}
Modified: branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_simple/Main.java
==============================================================================
--- branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_simple/Main.java (original)
+++ branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_simple/Main.java Fri Dec 25 09:27:34 2009
@@ -38,7 +38,7 @@
}
catch (Throwable t)
{
- System.out.println("abcl exception!");
+ System.out.println("exception!");
t.printStackTrace();
}
}
Modified: branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_simple/MainAlternative.java
==============================================================================
--- branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_simple/MainAlternative.java (original)
+++ branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_simple/MainAlternative.java Fri Dec 25 09:27:34 2009
@@ -47,7 +47,7 @@
}
catch (Throwable t)
{
- System.out.println("abcl exception!");
+ System.out.println("exception!");
t.printStackTrace();
}
}
Modified: branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_with_params_and_return/Main.java
==============================================================================
--- branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_with_params_and_return/Main.java (original)
+++ branches/fast-boot-preloading/abcl/examples/abcl/lispcall_from_java_with_params_and_return/Main.java Fri Dec 25 09:27:34 2009
@@ -65,7 +65,7 @@
}
catch (Throwable t)
{
- System.out.println("abcl exception!");
+ System.out.println("exception!");
t.printStackTrace();
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/AbstractArray.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/AbstractArray.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/AbstractArray.java Fri Dec 25 09:27:34 2009
@@ -294,23 +294,16 @@
@Override
public int psxhash()
{
- try {
- long result = 128387; // Chosen at random.
- final int rank = getRank();
- int limit = rank < 4 ? rank : 4;
- for (int i = 0; i < limit; i++)
- result = mix(result, getDimension(i));
- final int length = getTotalSize();
- limit = length < 4 ? length : 4;
- for (int i = 0; i < length; i++)
- result = mix(result, AREF(i).psxhash());
- return (int) (result & 0x7fffffff);
- }
- catch (Throwable t) {
- // Shouldn't happen.
- Debug.trace(t);
- return 0;
- }
+ long result = 128387; // Chosen at random.
+ final int rank = getRank();
+ int limit = rank < 4 ? rank : 4;
+ for (int i = 0; i < limit; i++)
+ result = mix(result, getDimension(i));
+ final int length = getTotalSize();
+ limit = length < 4 ? length : 4;
+ for (int i = 0; i < length; i++)
+ result = mix(result, AREF(i).psxhash());
+ return (int) (result & 0x7fffffff);
}
/** Returns a newly allocated array or the current array with
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/AbstractVector.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/AbstractVector.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/AbstractVector.java Fri Dec 25 09:27:34 2009
@@ -276,21 +276,12 @@
@Override
public int psxhash()
{
- try
- {
- final int length = length();
- final int limit = length < 4 ? length : 4;
- long result = 48920713; // Chosen at random.
- for (int i = 0; i < limit; i++)
- result = mix(result, AREF(i).psxhash());
- return (int) (result & 0x7fffffff);
- }
- catch (Throwable t)
- {
- // Shouldn't happen.
- Debug.trace(t);
- return 0;
- }
+ final int length = length();
+ final int limit = length < 4 ? length : 4;
+ long result = 48920713; // Chosen at random.
+ for (int i = 0; i < limit; i++)
+ result = mix(result, AREF(i).psxhash());
+ return (int) (result & 0x7fffffff);
}
public abstract AbstractArray adjustArray(int size,
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/BuiltInClass.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/BuiltInClass.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/BuiltInClass.java Fri Dec 25 09:27:34 2009
@@ -291,13 +291,6 @@
static
{
- try
- {
- StandardClass.initializeStandardClasses();
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- }
+ StandardClass.initializeStandardClasses();
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Condition.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Condition.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Condition.java Fri Dec 25 09:27:34 2009
@@ -98,15 +98,8 @@
{
super(StandardClass.CONDITION);
Debug.assertTrue(slots.length == 2);
- try
- {
- setFormatControl(message);
- setFormatArguments(NIL);
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- }
+ setFormatControl(message);
+ setFormatArguments(NIL);
}
public final LispObject getFormatControl()
@@ -177,11 +170,7 @@
LispObject formatControl = getFormatControl();
if (formatControl != NIL)
{
- try
- {
- return format(formatControl, getFormatArguments());
- }
- catch (Throwable t) {}
+ return format(formatControl, getFormatArguments());
}
return unreadableString(typeOf().writeToString());
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Go.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Go.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Go.java Fri Dec 25 09:27:34 2009
@@ -57,15 +57,9 @@
@Override
public LispObject getCondition()
{
- try {
- StringBuffer sb = new StringBuffer("No tag named ");
- sb.append(tag.writeToString());
- sb.append(" is currently visible");
- return new ControlError(sb.toString());
- }
- catch (Throwable t) {
- Debug.trace(t);
- return new Condition();
- }
+ StringBuffer sb = new StringBuffer("No tag named ");
+ sb.append(tag.writeToString());
+ sb.append(" is currently visible");
+ return new ControlError(sb.toString());
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Interpreter.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Interpreter.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Interpreter.java Fri Dec 25 09:27:34 2009
@@ -75,31 +75,28 @@
if (interpreter != null)
return null;
interpreter = new Interpreter();
- try {
- if (args != null)
- preprocessCommandLineArguments(args);
- if (!noinform) {
- Stream out = getStandardOutput();
- out._writeString(banner());
- out._finishOutput();
- }
- if (noinform)
- _NOINFORM_.setSymbolValue(T);
- else {
- double uptime = (System.currentTimeMillis() - Main.startTimeMillis) / 1000.0;
- getStandardOutput()._writeString("Low-level initialization completed in " +
- uptime + " seconds.\n");
- }
- initializeLisp();
- initializeTopLevel();
- if (!noinit)
- processInitializationFile();
- if (args != null)
- postprocessCommandLineArguments(args);
+
+ if (args != null)
+ preprocessCommandLineArguments(args);
+ if (!noinform) {
+ Stream out = getStandardOutput();
+ out._writeString(banner());
+ out._finishOutput();
}
- catch (Throwable t) {
- t.printStackTrace();
+ if (noinform)
+ _NOINFORM_.setSymbolValue(T);
+ else {
+ double uptime = (System.currentTimeMillis() - Main.startTimeMillis) / 1000.0;
+ getStandardOutput()._writeString("Low-level initialization completed in " +
+ uptime + " seconds.\n");
}
+ initializeLisp();
+ initializeTopLevel();
+ if (!noinit)
+ processInitializationFile();
+ if (args != null)
+ postprocessCommandLineArguments(args);
+
return interpreter;
}
@@ -112,15 +109,12 @@
if (interpreter != null)
return null;
interpreter = new Interpreter(in, out, initialDirectory);
- try {
- Stream stdout = getStandardOutput();
- stdout._writeLine(version);
- stdout._writeString(banner());
- stdout._finishOutput();
- }
- catch (Throwable t) {
- t.printStackTrace();
- }
+
+ Stream stdout = getStandardOutput();
+ stdout._writeLine(version);
+ stdout._writeString(banner());
+ stdout._finishOutput();
+
initializeJLisp();
initializeTopLevel();
processInitializationFile();
@@ -144,12 +138,7 @@
new Stream(outputStream, Symbol.CHARACTER));
if (!initialDirectory.endsWith(File.separator))
initialDirectory = initialDirectory.concat(File.separator);
- try {
- Symbol.DEFAULT_PATHNAME_DEFAULTS.setSymbolValue(new Pathname(initialDirectory));
- }
- catch (Throwable t) {
- Debug.trace(t);
- }
+ Symbol.DEFAULT_PATHNAME_DEFAULTS.setSymbolValue(new Pathname(initialDirectory));
}
// Interface.
@@ -170,17 +159,17 @@
public static synchronized void initializeJLisp()
{
if (!initialized) {
+ Symbol.FEATURES.setSymbolValue(new Cons(Keyword.J,
+ Symbol.FEATURES.getSymbolValue()));
+ Load.loadSystemFile("boot.lisp", false, false, false);
+
try {
- Symbol.FEATURES.setSymbolValue(new Cons(Keyword.J,
- Symbol.FEATURES.getSymbolValue()));
- Load.loadSystemFile("boot.lisp", false, false, false);
Class.forName("org.armedbear.j.LispAPI");
- Load.loadSystemFile("j.lisp");
- }
- catch (Throwable t) {
- // ### FIXME exception
- t.printStackTrace();
}
+ catch (ClassNotFoundException e) { } // FIXME: what to do?
+
+ Load.loadSystemFile("j.lisp");
+
initialized = true;
}
}
@@ -190,18 +179,14 @@
private static synchronized void initializeTopLevel()
{
if (!topLevelInitialized) {
- try {
- // Resolve top-level-loop autoload.
- Symbol TOP_LEVEL_LOOP = intern("TOP-LEVEL-LOOP", PACKAGE_TPL);
- LispObject tplFun = TOP_LEVEL_LOOP.getSymbolFunction();
- if (tplFun instanceof Autoload) {
- Autoload autoload = (Autoload) tplFun;
- autoload.load();
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
+ // Resolve top-level-loop autoload.
+ Symbol TOP_LEVEL_LOOP = intern("TOP-LEVEL-LOOP", PACKAGE_TPL);
+ LispObject tplFun = TOP_LEVEL_LOOP.getSymbolFunction();
+ if (tplFun instanceof Autoload) {
+ Autoload autoload = (Autoload) tplFun;
+ autoload.load();
}
+
topLevelInitialized = true;
}
}
@@ -216,8 +201,8 @@
return;
}
}
- catch (Throwable t) {
- t.printStackTrace();
+ catch (IOException e) {
+ e.printStackTrace();
}
}
@@ -385,36 +370,26 @@
private static void reportError(ControlTransfer c, LispThread thread)
{
- try {
- getStandardInput().clearInput();
- Stream out = getStandardOutput();
- out.freshLine();
- Condition condition = (Condition) c.getCondition();
- out._writeLine("Error: unhandled condition: " +
- condition.writeToString());
- if (thread != null)
- thread.printBacktrace();
- }
- catch (Throwable t) {
-
- }
+ getStandardInput().clearInput();
+ Stream out = getStandardOutput();
+ out.freshLine();
+ Condition condition = (Condition) c.getCondition();
+ out._writeLine("Error: unhandled condition: " +
+ condition.writeToString());
+ if (thread != null)
+ thread.printBacktrace();
}
private static void reportError(UnhandledCondition c, LispThread thread)
{
- try {
- getStandardInput().clearInput();
- Stream out = getStandardOutput();
- out.freshLine();
- Condition condition = (Condition) c.getCondition();
- out._writeLine("Error: unhandled condition: " +
- condition.writeToString());
- if (thread != null)
- thread.printBacktrace();
- }
- catch (Throwable t) {
-
- }
+ getStandardInput().clearInput();
+ Stream out = getStandardOutput();
+ out.freshLine();
+ Condition condition = (Condition) c.getCondition();
+ out._writeLine("Error: unhandled condition: " +
+ condition.writeToString());
+ if (thread != null)
+ thread.printBacktrace();
}
public void kill()
@@ -500,7 +475,7 @@
condition.typeOf().writeToString() + ':');
Debug.trace(" " + condition.writeToString());
}
- catch (Throwable t) {}
+ catch (Throwable t) {} // catch any exception to throw below
finally {
thread.resetSpecialBindings(mark);
}
@@ -511,13 +486,8 @@
public static final LispObject readFromString(String s)
{
- try {
- return new StringInputStream(s).read(true, NIL, false,
- LispThread.currentThread());
- }
- catch (Throwable t) {
- return null;
- }
+ return new StringInputStream(s).read(true, NIL, false,
+ LispThread.currentThread());
}
// For j.
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Java.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Java.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Java.java Fri Dec 25 09:27:34 2009
@@ -215,7 +215,7 @@
catch (IllegalArgumentException e) {
error(new LispError("illegal argument"));
}
- catch (Throwable t) {
+ catch (Throwable t) { // no code -> no ControlTransfer
error(new LispError(getMessage(t)));
}
// Not reached.
@@ -282,7 +282,7 @@
catch (ControlTransfer e) {
throw e;
}
- catch (Throwable t) {
+ catch (Throwable t) { // ControlTransfer addressed above
error(new LispError(getMessage(t)));
}
// Not reached.
@@ -340,7 +340,7 @@
catch (ControlTransfer e) {
throw e;
}
- catch (Throwable t) {
+ catch (Throwable t) { // ControlTransfer addressed above
error(new LispError(getMessage(t)));
}
// Not reached.
@@ -393,7 +393,10 @@
Object result = m.invoke(null, methodArgs);
return JavaObject.getInstance(result, translate);
}
- catch (Throwable t) {
+ catch (ControlTransfer c) {
+ throw c;
+ }
+ catch (Throwable t) { // ControlTransfer handled above
if (t instanceof InvocationTargetException)
t = t.getCause();
Symbol condition = getCondition(t.getClass());
@@ -458,7 +461,10 @@
}
return JavaObject.getInstance(constructor.newInstance(initargs));
}
- catch (Throwable t) {
+ catch (ControlTransfer c) {
+ throw c;
+ }
+ catch (Throwable t) { // ControlTransfer handled above
if (t instanceof InvocationTargetException)
t = t.getCause();
Symbol condition = getCondition(t.getClass());
@@ -494,7 +500,7 @@
dimensions[i-1] = ((Integer)args[i].javaInstance()).intValue();
return JavaObject.getInstance(Array.newInstance(c, dimensions));
}
- catch (Throwable t) {
+ catch (Throwable t) { // no code -> no ControlTransfer
error(new JavaException(t));
}
// Not reached.
@@ -514,7 +520,7 @@
return JavaObject.getInstance(Array.get(a,
((Integer)args[args.length - 1].javaInstance()).intValue()), translate);
}
- catch (Throwable t) {
+ catch (Throwable t) { // no code -> no ControlTransfer
Symbol condition = getCondition(t.getClass());
if (condition == null)
error(new JavaException(t));
@@ -572,7 +578,7 @@
Array.set(a, ((Integer)args[args.length - 1].javaInstance()).intValue(), v.javaInstance());
return v;
}
- catch (Throwable t) {
+ catch (Throwable t) { // no code -> no ControlTransfer
Symbol condition = getCondition(t.getClass());
if (condition == null)
error(new JavaException(t));
@@ -653,7 +659,7 @@
catch (ControlTransfer t) {
throw t;
}
- catch (Throwable t) {
+ catch (Throwable t) { // ControlTransfer handled above
if (t instanceof InvocationTargetException)
t = t.getCause();
Symbol condition = getCondition(t.getClass());
@@ -696,30 +702,23 @@
if (args.length < 1)
error(new WrongNumberOfArgumentsException(this));
LispObject object = args[0];
- try {
- if (args.length > 1) {
- LispObject type = args[1];
- if (type == Keyword.BOOLEAN) {
- if (object == NIL)
- return JavaObject.getInstance(Boolean.FALSE);
- else
- return JavaObject.getInstance(Boolean.TRUE);
- }
- if (type == Keyword.REF) {
- if (object == NIL)
- return JavaObject.getInstance(null);
- else
- throw new Error();
- }
- // other special cases come here
+ if (args.length > 1) {
+ LispObject type = args[1];
+ if (type == Keyword.BOOLEAN) {
+ if (object == NIL)
+ return JavaObject.getInstance(Boolean.FALSE);
+ else
+ return JavaObject.getInstance(Boolean.TRUE);
}
- return JavaObject.getInstance(object.javaInstance());
- }
- catch (Throwable t) {
- error(new LispError("MAKE-IMMEDIATE-OBJECT: not implemented"));
+ if (type == Keyword.REF) {
+ if (object == NIL)
+ return JavaObject.getInstance(null);
+ else
+ error(new LispError("MAKE-IMMEDIATE-OBJECT: not implemented"));
+ }
+ // other special cases come here
}
- // Not reached.
- return NIL;
+ return JavaObject.getInstance(object.javaInstance());
}
};
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/JavaClassLoader.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/JavaClassLoader.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/JavaClassLoader.java Fri Dec 25 09:27:34 2009
@@ -33,6 +33,8 @@
package org.armedbear.lisp;
+import static org.armedbear.lisp.Lisp.*;
+
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -70,7 +72,7 @@
}
public Class<?> loadClassFromByteArray(byte[] classbytes) {
- return loadClassFromByteArray(null, classbytes);
+ return loadClassFromByteArray(null, classbytes);
}
public Class<?> loadClassFromByteArray(String className,
@@ -87,9 +89,9 @@
}
}
}
- catch (LinkageError e) {
- throw e;
- }
+ catch (LinkageError e) {
+ throw e;
+ }
catch (Throwable t) {
Debug.trace(t);
}
@@ -106,6 +108,10 @@
return c;
}
}
+ catch (VerifyError e)
+ {
+ error(new LispError("Class verification failed: " + e.getMessage()));
+ }
catch (Throwable t) {
Debug.trace(t);
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Layout.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Layout.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Layout.java Fri Dec 25 09:27:34 2009
@@ -49,31 +49,16 @@
{
this.lispClass = lispClass;
Debug.assertTrue(instanceSlots.listp());
- int length = 0;
- try
- {
- length = instanceSlots.length();
- }
- catch (Throwable t)
- {
- // Shouldn't happen.
- Debug.trace(t);
- }
+ int length = instanceSlots.length();
slotNames = new LispObject[length];
int i = 0;
- try
- {
- while (instanceSlots != NIL)
- {
- slotNames[i++] = instanceSlots.car();
- instanceSlots = instanceSlots.cdr();
- }
- }
- catch (Throwable t)
+
+ while (instanceSlots != NIL)
{
- // Shouldn't happen.
- Debug.trace(t);
+ slotNames[i++] = instanceSlots.car();
+ instanceSlots = instanceSlots.cdr();
}
+
Debug.assertTrue(i == length);
this.sharedSlots = sharedSlots;
slotTable = initializeSlotTable(slotNames);
@@ -153,16 +138,9 @@
protected LispObject generateSlotDefinitions()
{
LispObject list = NIL;
- try
- {
- for (int i = slotNames.length; i-- > 0;)
- list = list.push(new SlotDefinition(slotNames[i], NIL));
- }
- catch (Throwable t)
- {
- // Shouldn't happen.
- Debug.trace(t);
- }
+ for (int i = slotNames.length; i-- > 0;)
+ list = list.push(new SlotDefinition(slotNames[i], NIL));
+
return list;
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Lisp.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Lisp.java Fri Dec 25 09:27:34 2009
@@ -35,9 +35,9 @@
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.reflect.Constructor;
import java.math.BigInteger;
import java.net.MalformedURLException;
import java.net.URL;
@@ -95,52 +95,45 @@
// We need NIL before we can call usePackage().
static
{
- try
- {
- PACKAGE_CL.addNickname("CL");
- PACKAGE_CL_USER.addNickname("CL-USER");
- PACKAGE_CL_USER.usePackage(PACKAGE_CL);
- PACKAGE_CL_USER.usePackage(PACKAGE_EXT);
- PACKAGE_CL_USER.usePackage(PACKAGE_JAVA);
- PACKAGE_SYS.addNickname("SYS");
- PACKAGE_SYS.usePackage(PACKAGE_CL);
- PACKAGE_SYS.usePackage(PACKAGE_EXT);
- PACKAGE_MOP.usePackage(PACKAGE_CL);
- PACKAGE_MOP.usePackage(PACKAGE_EXT);
- PACKAGE_MOP.usePackage(PACKAGE_SYS);
- PACKAGE_TPL.addNickname("TPL");
- PACKAGE_TPL.usePackage(PACKAGE_CL);
- PACKAGE_TPL.usePackage(PACKAGE_EXT);
- PACKAGE_EXT.addNickname("EXT");
- PACKAGE_EXT.usePackage(PACKAGE_CL);
- PACKAGE_EXT.usePackage(PACKAGE_THREADS);
- PACKAGE_JVM.usePackage(PACKAGE_CL);
- PACKAGE_JVM.usePackage(PACKAGE_EXT);
- PACKAGE_JVM.usePackage(PACKAGE_SYS);
- PACKAGE_LOOP.usePackage(PACKAGE_CL);
- PACKAGE_PROF.addNickname("PROF");
- PACKAGE_PROF.usePackage(PACKAGE_CL);
- PACKAGE_PROF.usePackage(PACKAGE_EXT);
- PACKAGE_JAVA.usePackage(PACKAGE_CL);
- PACKAGE_JAVA.usePackage(PACKAGE_EXT);
- PACKAGE_LISP.usePackage(PACKAGE_CL);
- PACKAGE_LISP.usePackage(PACKAGE_EXT);
- PACKAGE_LISP.usePackage(PACKAGE_SYS);
- PACKAGE_THREADS.usePackage(PACKAGE_CL);
- PACKAGE_THREADS.usePackage(PACKAGE_EXT);
- PACKAGE_THREADS.usePackage(PACKAGE_SYS);
- PACKAGE_FORMAT.usePackage(PACKAGE_CL);
- PACKAGE_FORMAT.usePackage(PACKAGE_EXT);
- PACKAGE_XP.usePackage(PACKAGE_CL);
- PACKAGE_PRECOMPILER.addNickname("PRE");
- PACKAGE_PRECOMPILER.usePackage(PACKAGE_CL);
- PACKAGE_PRECOMPILER.usePackage(PACKAGE_EXT);
- PACKAGE_PRECOMPILER.usePackage(PACKAGE_SYS);
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- }
+ PACKAGE_CL.addNickname("CL");
+ PACKAGE_CL_USER.addNickname("CL-USER");
+ PACKAGE_CL_USER.usePackage(PACKAGE_CL);
+ PACKAGE_CL_USER.usePackage(PACKAGE_EXT);
+ PACKAGE_CL_USER.usePackage(PACKAGE_JAVA);
+ PACKAGE_SYS.addNickname("SYS");
+ PACKAGE_SYS.usePackage(PACKAGE_CL);
+ PACKAGE_SYS.usePackage(PACKAGE_EXT);
+ PACKAGE_MOP.usePackage(PACKAGE_CL);
+ PACKAGE_MOP.usePackage(PACKAGE_EXT);
+ PACKAGE_MOP.usePackage(PACKAGE_SYS);
+ PACKAGE_TPL.addNickname("TPL");
+ PACKAGE_TPL.usePackage(PACKAGE_CL);
+ PACKAGE_TPL.usePackage(PACKAGE_EXT);
+ PACKAGE_EXT.addNickname("EXT");
+ PACKAGE_EXT.usePackage(PACKAGE_CL);
+ PACKAGE_EXT.usePackage(PACKAGE_THREADS);
+ PACKAGE_JVM.usePackage(PACKAGE_CL);
+ PACKAGE_JVM.usePackage(PACKAGE_EXT);
+ PACKAGE_JVM.usePackage(PACKAGE_SYS);
+ PACKAGE_LOOP.usePackage(PACKAGE_CL);
+ PACKAGE_PROF.addNickname("PROF");
+ PACKAGE_PROF.usePackage(PACKAGE_CL);
+ PACKAGE_PROF.usePackage(PACKAGE_EXT);
+ PACKAGE_JAVA.usePackage(PACKAGE_CL);
+ PACKAGE_JAVA.usePackage(PACKAGE_EXT);
+ PACKAGE_LISP.usePackage(PACKAGE_CL);
+ PACKAGE_LISP.usePackage(PACKAGE_EXT);
+ PACKAGE_LISP.usePackage(PACKAGE_SYS);
+ PACKAGE_THREADS.usePackage(PACKAGE_CL);
+ PACKAGE_THREADS.usePackage(PACKAGE_EXT);
+ PACKAGE_THREADS.usePackage(PACKAGE_SYS);
+ PACKAGE_FORMAT.usePackage(PACKAGE_CL);
+ PACKAGE_FORMAT.usePackage(PACKAGE_EXT);
+ PACKAGE_XP.usePackage(PACKAGE_CL);
+ PACKAGE_PRECOMPILER.addNickname("PRE");
+ PACKAGE_PRECOMPILER.usePackage(PACKAGE_CL);
+ PACKAGE_PRECOMPILER.usePackage(PACKAGE_EXT);
+ PACKAGE_PRECOMPILER.usePackage(PACKAGE_SYS);
}
// End-of-file marker.
@@ -291,16 +284,11 @@
thread.backtrace(0));
return error(new StorageCondition("Stack overflow."));
}
- catch (Go go)
- {
- throw go;
- }
- catch (Throw t)
+ catch (ControlTransfer c)
{
- return error(new ControlError("Attempt to throw to the nonexistent tag " +
- t.tag.writeToString() + "."));
+ throw c;
}
- catch (Throwable t)
+ catch (Throwable t) // ControlTransfer handled above
{
Debug.trace(t);
thread.setSpecialVariable(_SAVED_BACKTRACE_,
@@ -1209,37 +1197,18 @@
// Used by the compiler.
public static final LispObject readObjectFromString(String s)
{
- try
- {
- return new StringInputStream(s).faslRead(true, NIL, false,
- LispThread.currentThread());
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- return null;
- }
+ return new StringInputStream(s).faslRead(true, NIL, false,
+ LispThread.currentThread());
}
public static final LispObject loadCompiledFunction(final String namestring)
{
- try {
byte[] bytes = readFunctionBytes(namestring);
if (bytes != null)
return loadClassBytes(bytes);
- }
- catch (VerifyError e)
- {
- return error(new LispError("Class verification failed: " +
- e.getMessage()));
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- }
- return error(new FileError("File not found: " + namestring,
- new Pathname(namestring)));
+
+ return null;
}
public static final byte[] readFunctionBytes(final String namestring)
@@ -1347,10 +1316,6 @@
{
Debug.trace(e);
}
- catch (Throwable t)
- {
- Debug.trace(t);
- }
}
error(new LispError("Unable to load " + namestring));
return null; // not reached
@@ -1368,17 +1333,11 @@
if (bytes != null)
return bytes;
}
- catch (VerifyError e)
- {
- error(new LispError("Class verification failed: " +
- e.getMessage()));
+ catch (FileNotFoundException fnf) {
+ error(new LispError("Unable to load " + pathname.writeToString()
+ + ": " + fnf.getMessage()));
return null; // not reached
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- }
- error(new LispError("Unable to load " + pathname.writeToString()));
+ }
return null; // not reached
}
try
@@ -1405,7 +1364,7 @@
ZipCache.removeZip(zipFile.getName());
}
}
- catch (Throwable t)
+ catch (IOException t)
{
Debug.trace(t);
}
@@ -1432,21 +1391,11 @@
public static final LispObject loadCompiledFunction(InputStream in, int size)
{
- try {
byte[] bytes = readFunctionBytes(in, size);
if (bytes != null)
return loadClassBytes(bytes);
- }
- catch (VerifyError e)
- {
- return error(new LispError("Class verification failed: " +
- e.getMessage()));
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- }
- return error(new FileError("Can't read file off stream."));
+ else
+ return error(new FileError("Can't read file off stream."));
}
@@ -1472,22 +1421,20 @@
return bytes;
}
- catch (Throwable t)
+ catch (IOException t)
{
- Debug.trace(t);
+ Debug.trace(t); // FIXME: call error()?
}
return null;
}
public static final Function loadClassBytes(byte[] bytes)
- throws Throwable
{
- return loadClassBytes(bytes, new JavaClassLoader());
+ return loadClassBytes(bytes, new JavaClassLoader());
}
public static final Function loadClassBytes(byte[] bytes,
JavaClassLoader cl)
- throws Throwable
{
Class<?> c = cl.loadClassFromByteArray(null, bytes, 0, bytes.length);
Function obj = makeCompiledFunctionFromClass(c);
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/LispStackFrame.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/LispStackFrame.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/LispStackFrame.java Fri Dec 25 09:27:34 2009
@@ -121,7 +121,7 @@
try {
result = unreadableString(LISP_STACK_FRAME + " "
+ toLispString().getStringValue());
- } catch (Throwable t) {
+ } catch (Throwable t) { // error while printing stack
Debug.trace("Serious printing error: ");
Debug.trace(t);
result = unreadableString(LISP_STACK_FRAME);
@@ -192,7 +192,7 @@
String result;
try {
result = this.toLispList().writeToString();
- } catch (Throwable t) {
+ } catch (Throwable t) { // error while printing stack
Debug.trace("Serious printing error: ");
Debug.trace(t);
result = unreadableString("LISP-STACK-FRAME");
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/LispThread.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/LispThread.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/LispThread.java Fri Dec 25 09:27:34 2009
@@ -90,7 +90,7 @@
catch (ThreadDestroyed ignored) {
// Might happen.
}
- catch (Throwable t) {
+ catch (Throwable t) { // any error: process thread interrupts
if (isInterrupted()) {
processThreadInterrupts();
}
@@ -723,29 +723,24 @@
public void printBacktrace(int limit)
{
if (stack != null) {
- try {
- int count = 0;
- Stream out =
- checkCharacterOutputStream(Symbol.TRACE_OUTPUT.symbolValue());
- out._writeLine("Evaluation stack:");
- out._finishOutput();
+ int count = 0;
+ Stream out =
+ checkCharacterOutputStream(Symbol.TRACE_OUTPUT.symbolValue());
+ out._writeLine("Evaluation stack:");
+ out._finishOutput();
+
+ StackFrame s = stack;
+ while (s != null) {
+ out._writeString(" ");
+ out._writeString(String.valueOf(count));
+ out._writeString(": ");
- StackFrame s = stack;
- while (s != null) {
- out._writeString(" ");
- out._writeString(String.valueOf(count));
- out._writeString(": ");
-
- pprint(s.toLispList(), out.getCharPos(), out);
- out.terpri();
- out._finishOutput();
- if (limit > 0 && ++count == limit)
- break;
- s = s.next;
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
+ pprint(s.toLispList(), out.getCharPos(), out);
+ out.terpri();
+ out._finishOutput();
+ if (limit > 0 && ++count == limit)
+ break;
+ s = s.next;
}
}
}
@@ -755,17 +750,12 @@
LispObject result = NIL;
if (stack != null) {
int count = 0;
- try {
- StackFrame s = stack;
- while (s != null) {
- result = result.push(s);
- if (limit > 0 && ++count == limit)
- break;
- s = s.getNext();
- }
- }
- catch (Throwable t) {
- t.printStackTrace();
+ StackFrame s = stack;
+ while (s != null) {
+ result = result.push(s);
+ if (limit > 0 && ++count == limit)
+ break;
+ s = s.getNext();
}
}
return result.nreverse();
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Load.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Load.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Load.java Fri Dec 25 09:27:34 2009
@@ -180,7 +180,7 @@
try {
zipfile = ZipCache.getZip(zipFileName);
}
- catch (Throwable t) {
+ catch (IOException e) {
return error (new FileError("Zip file not found: " + filename, pathname));
}
ZipEntry entry = zipfile.getEntry(zipEntryName);
@@ -374,10 +374,8 @@
catch (ZipException e) {
// Fall through.
}
- catch (Throwable t) {
- Debug.trace(t);
- in = null;
- // Fall through.
+ catch (IOException e) {
+ // fall through
}
}
if (in == null) {
@@ -675,7 +673,7 @@
&& bytes[2] == 0x03
&& bytes[3] == 0x04);
}
- catch (Throwable t) {
+ catch (Throwable t) { // any error probably means 'no'
return false;
}
finally {
@@ -683,7 +681,7 @@
try {
in.close();
}
- catch (Throwable t) {}
+ catch (IOException e) {} // ignore exceptions
}
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/MathFunctions.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/MathFunctions.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/MathFunctions.java Fri Dec 25 09:27:34 2009
@@ -268,23 +268,11 @@
im);
}
if (arg instanceof SingleFloat) {
- try {
- double d = Math.sinh(((SingleFloat)arg).value);
- return new SingleFloat((float)d);
- }
- catch (Throwable t) {
- Debug.trace(t);
- // Fall through...
- }
+ double d = Math.sinh(((SingleFloat)arg).value);
+ return new SingleFloat((float)d);
} else if (arg instanceof DoubleFloat) {
- try {
- double d = Math.sinh(((DoubleFloat)arg).value);
- return new DoubleFloat(d);
- }
- catch (Throwable t) {
- Debug.trace(t);
- // Fall through...
- }
+ double d = Math.sinh(((DoubleFloat)arg).value);
+ return new DoubleFloat(d);
}
LispObject result = exp(arg);
result = result.subtract(exp(arg.multiplyBy(Fixnum.MINUS_ONE)));
@@ -318,23 +306,11 @@
im);
}
if (arg instanceof SingleFloat) {
- try {
- double d = Math.cosh(((SingleFloat)arg).value);
- return new SingleFloat((float)d);
- }
- catch (Throwable t) {
- Debug.trace(t);
- // Fall through...
- }
+ double d = Math.cosh(((SingleFloat)arg).value);
+ return new SingleFloat((float)d);
} else if (arg instanceof DoubleFloat) {
- try {
- double d = Math.cosh(((DoubleFloat)arg).value);
- return new DoubleFloat(d);
- }
- catch (Throwable t) {
- Debug.trace(t);
- // Fall through...
- }
+ double d = Math.cosh(((DoubleFloat)arg).value);
+ return new DoubleFloat(d);
}
LispObject result = exp(arg);
result = result.add(exp(arg.multiplyBy(Fixnum.MINUS_ONE)));
@@ -356,23 +332,11 @@
public LispObject execute(LispObject arg)
{
if (arg instanceof SingleFloat) {
- try {
- double d = Math.tanh(((SingleFloat)arg).value);
- return new SingleFloat((float)d);
- }
- catch (Throwable t) {
- Debug.trace(t);
- // Fall through...
- }
+ double d = Math.tanh(((SingleFloat)arg).value);
+ return new SingleFloat((float)d);
} else if (arg instanceof DoubleFloat) {
- try {
- double d = Math.tanh(((DoubleFloat)arg).value);
- return new DoubleFloat(d);
- }
- catch (Throwable t) {
- Debug.trace(t);
- // Fall through...
- }
+ double d = Math.tanh(((DoubleFloat)arg).value);
+ return new DoubleFloat(d);
}
return sinh(arg).divideBy(cosh(arg));
}
@@ -576,19 +540,13 @@
{
if (number.realp() && !number.minusp()
&& base.isEqualTo(Fixnum.getInstance(10))) {
- try {
- double d =
- Math.log10(DoubleFloat.coerceToFloat(number).value);
- if (number instanceof DoubleFloat
- || base instanceof DoubleFloat)
- return new DoubleFloat(d);
- else
- return new SingleFloat((float)d);
- }
- catch (Throwable t) {
- Debug.trace(t);
- // Fall through...
- }
+ double d =
+ Math.log10(DoubleFloat.coerceToFloat(number).value);
+ if (number instanceof DoubleFloat
+ || base instanceof DoubleFloat)
+ return new DoubleFloat(d);
+ else
+ return new SingleFloat((float)d);
}
return log(number).divideBy(log(base));
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Package.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Package.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Package.java Fri Dec 25 09:27:34 2009
@@ -263,27 +263,18 @@
{
Debug.assertTrue(symbol.getPackage() == this);
Debug.assertTrue(symbol.getName().equals("NIL"));
- try {
- externalSymbols.put(symbol.name, symbol);
- }
- catch (Throwable t) {
- Debug.trace(t); // FIXME
- }
+ externalSymbols.put(symbol.name, symbol);
}
private synchronized Symbol addSymbol(SimpleString name, int hash)
{
Symbol symbol = new Symbol(name, hash, this);
- try {
- if (this == PACKAGE_KEYWORD) {
- symbol.initializeConstant(symbol);
- externalSymbols.put(name, symbol);
- } else
- internalSymbols.put(name, symbol);
- }
- catch (Throwable t) {
- Debug.trace(t); // FIXME
- }
+ if (this == PACKAGE_KEYWORD) {
+ symbol.initializeConstant(symbol);
+ externalSymbols.put(name, symbol);
+ } else
+ internalSymbols.put(name, symbol);
+
return symbol;
}
@@ -318,18 +309,13 @@
return symbol;
// Look in external symbols of used packages.
if (useList instanceof Cons) {
- try {
- LispObject usedPackages = useList;
- while (usedPackages != NIL) {
- Package pkg = (Package) usedPackages.car();
- symbol = pkg.findExternalSymbol(symbolName, hash);
- if (symbol != null)
- return symbol;
- usedPackages = usedPackages.cdr();
- }
- }
- catch (Throwable t) {
- Debug.trace(t);
+ LispObject usedPackages = useList;
+ while (usedPackages != NIL) {
+ Package pkg = (Package) usedPackages.car();
+ symbol = pkg.findExternalSymbol(symbolName, hash);
+ if (symbol != null)
+ return symbol;
+ usedPackages = usedPackages.cdr();
}
}
// Not found.
@@ -349,18 +335,13 @@
return (Symbol) thread.setValues(symbol, Keyword.INTERNAL);
// Look in external symbols of used packages.
if (useList instanceof Cons) {
- try {
- LispObject usedPackages = useList;
- while (usedPackages != NIL) {
- Package pkg = (Package) usedPackages.car();
- symbol = pkg.findExternalSymbol(s, hash);
- if (symbol != null)
- return (Symbol) thread.setValues(symbol, Keyword.INHERITED);
- usedPackages = usedPackages.cdr();
- }
- }
- catch (Throwable t) {
- Debug.trace(t);
+ LispObject usedPackages = useList;
+ while (usedPackages != NIL) {
+ Package pkg = (Package) usedPackages.car();
+ symbol = pkg.findExternalSymbol(s, hash);
+ if (symbol != null)
+ return (Symbol) thread.setValues(symbol, Keyword.INHERITED);
+ usedPackages = usedPackages.cdr();
}
}
// Not found.
@@ -756,21 +737,16 @@
list.addAll(internalSymbols.getSymbols());
list.addAll(externalSymbols.getSymbols());
if (useList instanceof Cons) {
- try {
- LispObject usedPackages = useList;
- while (usedPackages != NIL) {
- Package pkg = (Package) usedPackages.car();
- List<Symbol> symbols = pkg.externalSymbols.getSymbols();
- for (int i = 0; i < symbols.size(); i++) {
- Symbol symbol = (Symbol) symbols.get(i);
- if (shadowingSymbols == null || shadowingSymbols.get(symbol.getName()) == null)
- list.add(symbol);
- }
- usedPackages = usedPackages.cdr();
+ LispObject usedPackages = useList;
+ while (usedPackages != NIL) {
+ Package pkg = (Package) usedPackages.car();
+ List<Symbol> symbols = pkg.externalSymbols.getSymbols();
+ for (int i = 0; i < symbols.size(); i++) {
+ Symbol symbol = (Symbol) symbols.get(i);
+ if (shadowingSymbols == null || shadowingSymbols.get(symbol.getName()) == null)
+ list.add(symbol);
}
- }
- catch (Throwable t) {
- Debug.trace(t);
+ usedPackages = usedPackages.cdr();
}
}
return list;
@@ -798,24 +774,19 @@
{
LispObject list = NIL;
if (useList instanceof Cons) {
- try {
- LispObject usedPackages = useList;
- while (usedPackages != NIL) {
- Package pkg = (Package) usedPackages.car();
- List externals = pkg.getExternalSymbols();
- for (int i = externals.size(); i-- > 0;) {
- Symbol symbol = (Symbol) externals.get(i);
- if (shadowingSymbols != null && shadowingSymbols.get(symbol.getName()) != null)
- continue;
- if (externalSymbols.get(symbol.name) == symbol)
- continue;
- list = new Cons(symbol, list);
- }
- usedPackages = usedPackages.cdr();
+ LispObject usedPackages = useList;
+ while (usedPackages != NIL) {
+ Package pkg = (Package) usedPackages.car();
+ List externals = pkg.getExternalSymbols();
+ for (int i = externals.size(); i-- > 0;) {
+ Symbol symbol = (Symbol) externals.get(i);
+ if (shadowingSymbols != null && shadowingSymbols.get(symbol.getName()) != null)
+ continue;
+ if (externalSymbols.get(symbol.name) == symbol)
+ continue;
+ list = new Cons(symbol, list);
}
- }
- catch (Throwable t) {
- Debug.trace(t);
+ usedPackages = usedPackages.cdr();
}
}
return list;
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Pathname.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Pathname.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Pathname.java Fri Dec 25 09:27:34 2009
@@ -497,11 +497,7 @@
boolean printEscape = (Symbol.PRINT_ESCAPE.symbolValue(thread) != NIL);
boolean useNamestring;
String s = null;
- try {
- s = getNamestring();
- }
- // ### FIXME exception
- catch (Throwable t) {}
+ s = getNamestring();
if (s != null) {
useNamestring = true;
if (printReadably) {
@@ -1388,12 +1384,7 @@
};
static {
- try {
- LispObject obj = Symbol.DEFAULT_PATHNAME_DEFAULTS.getSymbolValue();
- Symbol.DEFAULT_PATHNAME_DEFAULTS.setSymbolValue(coerceToPathname(obj));
- }
- catch (Throwable t) {
- Debug.trace(t);
- }
+ LispObject obj = Symbol.DEFAULT_PATHNAME_DEFAULTS.getSymbolValue();
+ Symbol.DEFAULT_PATHNAME_DEFAULTS.setSymbolValue(coerceToPathname(obj));
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/PrintNotReadable.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/PrintNotReadable.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/PrintNotReadable.java Fri Dec 25 09:27:34 2009
@@ -83,12 +83,7 @@
{
FastStringBuffer sb = new FastStringBuffer();
LispObject object = UNBOUND_VALUE;
- try {
- object = getInstanceSlotValue(Symbol.OBJECT);
- }
- catch (Throwable t) {
- Debug.trace(t);
- }
+ object = getInstanceSlotValue(Symbol.OBJECT);
if (object != UNBOUND_VALUE) {
final LispThread thread = LispThread.currentThread();
final SpecialBindingsMark mark = thread.markSpecialBindings();
@@ -97,9 +92,6 @@
try {
sb.append(object.writeToString());
}
- catch (Throwable t) {
- sb.append("Object");
- }
finally {
thread.resetSpecialBindings(mark);
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/RandomState.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/RandomState.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/RandomState.java Fri Dec 25 09:27:34 2009
@@ -64,9 +64,9 @@
ObjectInputStream in = new ObjectInputStream(fileIn);
random = (Random) in.readObject();
in.close();
- file.delete();
+ file.delete(); // FIXME: file leak on exception
}
- catch (Throwable t) {
+ catch (Throwable t) { // ANY exception gets converted to a lisp error
error(new LispError("Unable to copy random state."));
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Return.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Return.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Return.java Fri Dec 25 09:27:34 2009
@@ -71,15 +71,9 @@
@Override
public LispObject getCondition()
{
- try {
- FastStringBuffer sb = new FastStringBuffer("No block named ");
- sb.append(tag.writeToString());
- sb.append(" is currently visible.");
- return new ControlError(sb.toString());
- }
- catch (Throwable t) {
- Debug.trace(t);
- return new Condition();
- }
+ FastStringBuffer sb = new FastStringBuffer("No block named ");
+ sb.append(tag.writeToString());
+ sb.append(" is currently visible.");
+ return new ControlError(sb.toString());
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/RuntimeClass.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/RuntimeClass.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/RuntimeClass.java Fri Dec 25 09:27:34 2009
@@ -122,9 +122,6 @@
return error(new LispError("class could not be linked: " +
e.getMessage()));
}
- catch (Throwable t) {
- Debug.trace(t);
- }
return error(
new LispError("unable to load ".concat(cn)));
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/ShellCommand.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/ShellCommand.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/ShellCommand.java Fri Dec 25 09:27:34 2009
@@ -204,12 +204,7 @@
String s = read();
if (s == null)
return;
- try {
- processOutput(s);
- }
- catch (Throwable t) {
- Debug.trace(t);
- }
+ processOutput(s);
}
}
@@ -234,9 +229,6 @@
catch (InterruptedException e) {
return null;
}
- catch (Throwable t) {
- return null;
- }
return sb.toString();
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SimpleTypeError.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SimpleTypeError.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SimpleTypeError.java Fri Dec 25 09:27:34 2009
@@ -72,21 +72,17 @@
@Override
public String getMessage()
{
- try {
- LispObject formatControl = getFormatControl();
- if (formatControl != NIL) {
- LispObject formatArguments = getFormatArguments();
- // (apply 'format (append '(nil format-control) format-arguments))
- LispObject result =
- Primitives.APPLY.execute(Symbol.FORMAT,
- Primitives.APPEND.execute(list(NIL,
- formatControl),
- formatArguments));
- return result.getStringValue();
- }
- return super.getMessage();
+ LispObject formatControl = getFormatControl();
+ if (formatControl != NIL) {
+ LispObject formatArguments = getFormatArguments();
+ // (apply 'format (append '(nil format-control) format-arguments))
+ LispObject result =
+ Primitives.APPLY.execute(Symbol.FORMAT,
+ Primitives.APPEND.execute(list(NIL,
+ formatControl),
+ formatArguments));
+ return result.getStringValue();
}
- catch (Throwable t) {}
- return null;
+ return super.getMessage();
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Site.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Site.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Site.java Fri Dec 25 09:27:34 2009
@@ -83,13 +83,8 @@
exportSpecial("*LISP-HOME*", PACKAGE_EXT, NIL);
static {
- try {
- String s = Site.getLispHome();
- if (s != null)
- _LISP_HOME_.setSymbolValue(new Pathname(s));
- }
- catch (Throwable t) {
- Debug.trace(t);
- }
+ String s = Site.getLispHome();
+ if (s != null)
+ _LISP_HOME_.setSymbolValue(new Pathname(s));
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SiteName.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SiteName.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SiteName.java Fri Dec 25 09:27:34 2009
@@ -36,18 +36,23 @@
import static org.armedbear.lisp.Lisp.*;
import java.net.InetAddress;
+import java.net.UnknownHostException;
public final class SiteName
{
private static LispObject getHostName()
{
String hostName = null;
+ InetAddress addr;
try {
- InetAddress addr = InetAddress.getLocalHost();
- if (addr != null)
- hostName = addr.getHostName();
+ addr = InetAddress.getLocalHost();
}
- catch (Throwable t) {}
+ catch (UnknownHostException e) {
+ addr = null;
+ }
+ if (addr != null)
+ hostName = addr.getHostName();
+
return hostName != null ? new SimpleString(hostName) : NIL;
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlimeInputStream.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlimeInputStream.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlimeInputStream.java Fri Dec 25 09:27:34 2009
@@ -96,13 +96,8 @@
protected int _readChar()
{
if (offset >= length) {
- try {
- ostream.finishOutput();
- s = LispThread.currentThread().execute(f).getStringValue();
- }
- catch (Throwable t) {
- return -1;
- }
+ ostream.finishOutput();
+ s = LispThread.currentThread().execute(f).getStringValue();
if (s.length() == 0)
return -1;
offset = 0;
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlotClass.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlotClass.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlotClass.java Fri Dec 25 09:27:34 2009
@@ -123,43 +123,39 @@
{
if (isFinalized())
return;
- try {
- Debug.assertTrue(slotDefinitions == NIL);
- LispObject cpl = getCPL();
- Debug.assertTrue(cpl != null);
- Debug.assertTrue(cpl.listp());
- cpl = cpl.reverse();
- while (cpl != NIL) {
- LispObject car = cpl.car();
- if (car instanceof StandardClass) {
- StandardClass cls = (StandardClass) car;
- LispObject defs = cls.getDirectSlotDefinitions();
- Debug.assertTrue(defs != null);
- Debug.assertTrue(defs.listp());
- while (defs != NIL) {
- slotDefinitions = slotDefinitions.push(defs.car());
- defs = defs.cdr();
- }
+
+ Debug.assertTrue(slotDefinitions == NIL);
+ LispObject cpl = getCPL();
+ Debug.assertTrue(cpl != null);
+ Debug.assertTrue(cpl.listp());
+ cpl = cpl.reverse();
+ while (cpl != NIL) {
+ LispObject car = cpl.car();
+ if (car instanceof StandardClass) {
+ StandardClass cls = (StandardClass) car;
+ LispObject defs = cls.getDirectSlotDefinitions();
+ Debug.assertTrue(defs != null);
+ Debug.assertTrue(defs.listp());
+ while (defs != NIL) {
+ slotDefinitions = slotDefinitions.push(defs.car());
+ defs = defs.cdr();
}
- cpl = cpl.cdr();
}
- slotDefinitions = slotDefinitions.nreverse();
- LispObject[] instanceSlotNames = new LispObject[slotDefinitions.length()];
- int i = 0;
- LispObject tail = slotDefinitions;
- while (tail != NIL) {
- SlotDefinition slotDefinition = (SlotDefinition) tail.car();
- slotDefinition.setLocation(i);
- instanceSlotNames[i++] = slotDefinition.getName();
- tail = tail.cdr();
- }
- setClassLayout(new Layout(this, instanceSlotNames, NIL));
- setDefaultInitargs(computeDefaultInitargs());
- setFinalized(true);
- }
- catch (Throwable t) {
- Debug.trace(t);
+ cpl = cpl.cdr();
}
+ slotDefinitions = slotDefinitions.nreverse();
+ LispObject[] instanceSlotNames = new LispObject[slotDefinitions.length()];
+ int i = 0;
+ LispObject tail = slotDefinitions;
+ while (tail != NIL) {
+ SlotDefinition slotDefinition = (SlotDefinition) tail.car();
+ slotDefinition.setLocation(i);
+ instanceSlotNames[i++] = slotDefinition.getName();
+ tail = tail.cdr();
+ }
+ setClassLayout(new Layout(this, instanceSlotNames, NIL));
+ setDefaultInitargs(computeDefaultInitargs());
+ setFinalized(true);
}
// ### class-direct-slots
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlotDefinition.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlotDefinition.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SlotDefinition.java Fri Dec 25 09:27:34 2009
@@ -47,41 +47,27 @@
public SlotDefinition(LispObject name, LispObject readers)
{
this();
- try
- {
- Debug.assertTrue(name instanceof Symbol);
- slots[SlotDefinitionClass.SLOT_INDEX_NAME] = name;
- slots[SlotDefinitionClass.SLOT_INDEX_INITFUNCTION] = NIL;
- slots[SlotDefinitionClass.SLOT_INDEX_INITARGS] =
- new Cons(PACKAGE_KEYWORD.intern(((Symbol)name).getName()));
- slots[SlotDefinitionClass.SLOT_INDEX_READERS] = readers;
- slots[SlotDefinitionClass.SLOT_INDEX_ALLOCATION] = Keyword.INSTANCE;
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- }
+ Debug.assertTrue(name instanceof Symbol);
+ slots[SlotDefinitionClass.SLOT_INDEX_NAME] = name;
+ slots[SlotDefinitionClass.SLOT_INDEX_INITFUNCTION] = NIL;
+ slots[SlotDefinitionClass.SLOT_INDEX_INITARGS] =
+ new Cons(PACKAGE_KEYWORD.intern(((Symbol)name).getName()));
+ slots[SlotDefinitionClass.SLOT_INDEX_READERS] = readers;
+ slots[SlotDefinitionClass.SLOT_INDEX_ALLOCATION] = Keyword.INSTANCE;
}
public SlotDefinition(LispObject name, LispObject readers,
LispObject initForm)
{
this();
- try
- {
- Debug.assertTrue(name instanceof Symbol);
- slots[SlotDefinitionClass.SLOT_INDEX_NAME] = name;
- slots[SlotDefinitionClass.SLOT_INDEX_INITFUNCTION] = NIL;
- slots[SlotDefinitionClass.SLOT_INDEX_INITFORM] = initForm;
- slots[SlotDefinitionClass.SLOT_INDEX_INITARGS] =
- new Cons(PACKAGE_KEYWORD.intern(((Symbol)name).getName()));
- slots[SlotDefinitionClass.SLOT_INDEX_READERS] = readers;
- slots[SlotDefinitionClass.SLOT_INDEX_ALLOCATION] = Keyword.INSTANCE;
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- }
+ Debug.assertTrue(name instanceof Symbol);
+ slots[SlotDefinitionClass.SLOT_INDEX_NAME] = name;
+ slots[SlotDefinitionClass.SLOT_INDEX_INITFUNCTION] = NIL;
+ slots[SlotDefinitionClass.SLOT_INDEX_INITFORM] = initForm;
+ slots[SlotDefinitionClass.SLOT_INDEX_INITARGS] =
+ new Cons(PACKAGE_KEYWORD.intern(((Symbol)name).getName()));
+ slots[SlotDefinitionClass.SLOT_INDEX_READERS] = readers;
+ slots[SlotDefinitionClass.SLOT_INDEX_ALLOCATION] = Keyword.INSTANCE;
}
public static SlotDefinition checkSlotDefination(LispObject obj) {
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Symbol.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Symbol.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Symbol.java Fri Dec 25 09:27:34 2009
@@ -247,39 +247,23 @@
public final String getName()
{
- try
- {
- return name.getStringValue();
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- return null;
- }
+ return name.getStringValue();
}
public final String getQualifiedName()
{
- try
- {
- final String n = name.getStringValue();
- if (pkg == NIL)
- return("#:".concat(n));
- if (pkg == PACKAGE_KEYWORD)
- return ":".concat(n);
- FastStringBuffer sb = new FastStringBuffer(((Package)pkg).getName());
- if (((Package)pkg).findExternalSymbol(name) != null)
- sb.append(':');
- else
- sb.append("::");
- sb.append(n);
- return sb.toString();
- }
- catch (Throwable t)
- {
- Debug.trace(t);
- return null;
- }
+ final String n = name.getStringValue();
+ if (pkg == NIL)
+ return("#:".concat(n));
+ if (pkg == PACKAGE_KEYWORD)
+ return ":".concat(n);
+ FastStringBuffer sb = new FastStringBuffer(((Package)pkg).getName());
+ if (((Package)pkg).findExternalSymbol(name) != null)
+ sb.append(':');
+ else
+ sb.append("::");
+ sb.append(n);
+ return sb.toString();
}
/** Gets the value associated with the symbol
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SymbolHashTable.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SymbolHashTable.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/SymbolHashTable.java Fri Dec 25 09:27:34 2009
@@ -65,13 +65,8 @@
{
HashEntry e = buckets[key.sxhash() & mask];
while (e != null) {
- try {
- if (key.equal(e.symbol.name))
- return e.symbol; // Return the symbol.
- }
- catch (Throwable t) {
- Debug.trace(t); // Shouldn't happen.
- }
+ if (key.equal(e.symbol.name))
+ return e.symbol; // Return the symbol.
e = e.next;
}
return null;
@@ -81,13 +76,8 @@
{
HashEntry e = buckets[hash & mask];
while (e != null) {
- try {
- if (key.equal(e.symbol.name))
- return e.symbol; // Return the symbol.
- }
- catch (Throwable t) {
- Debug.trace(t); // Shouldn't happen.
- }
+ if (key.equal(e.symbol.name))
+ return e.symbol; // Return the symbol.
e = e.next;
}
return null;
@@ -98,19 +88,14 @@
int index = key.sxhash() & mask;
HashEntry e = buckets[index];
while (e != null) {
- try {
- if (key.equal(e.symbol.name)) {
- if (e.symbol != symbol) {
- Debug.trace("replacing existing key for " + key.getStringValue() +
- " in package " + e.symbol.getPackage().writeToString());
- Thread.dumpStack();
- e.symbol = symbol;
- }
- return;
+ if (key.equal(e.symbol.name)) {
+ if (e.symbol != symbol) {
+ Debug.trace("replacing existing key for " + key.getStringValue() +
+ " in package " + e.symbol.getPackage().writeToString());
+ Thread.dumpStack();
+ e.symbol = symbol;
}
- }
- catch (Throwable t) {
- Debug.trace(t); // FIXME
+ return;
}
e = e.next;
}
@@ -130,18 +115,13 @@
int index = symbol.sxhash() & mask;
HashEntry e = buckets[index];
while (e != null) {
- try {
- if (symbol.name.equal(e.symbol.name)) {
- if (e.symbol != symbol) {
- Debug.trace("replacing existing key for " + symbol.getName());
- Thread.dumpStack();
- e.symbol = symbol; // Replace existing key.
- }
- return;
+ if (symbol.name.equal(e.symbol.name)) {
+ if (e.symbol != symbol) {
+ Debug.trace("replacing existing key for " + symbol.getName());
+ Thread.dumpStack();
+ e.symbol = symbol; // Replace existing key.
}
- }
- catch (Throwable t) {
- Debug.trace(t); // FIXME
+ return;
}
e = e.next;
}
@@ -164,18 +144,13 @@
HashEntry e = buckets[index];
HashEntry last = null;
while (e != null) {
- try {
- if (key.equal(e.symbol.name)) {
- if (last == null)
- buckets[index] = e.next;
- else
- last.next = e.next;
- --count;
- return e.symbol; // The key is the value!
- }
- }
- catch (Throwable t) {
- Debug.trace(t); // FIXME
+ if (key.equal(e.symbol.name)) {
+ if (last == null)
+ buckets[index] = e.next;
+ else
+ last.next = e.next;
+ --count;
+ return e.symbol; // The key is the value!
}
last = e;
e = e.next;
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Throw.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Throw.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/Throw.java Fri Dec 25 09:27:34 2009
@@ -56,13 +56,7 @@
@Override
public LispObject getCondition()
{
- try {
- return new ControlError("Attempt to throw to the nonexistent tag " +
- tag.writeToString() + ".");
- }
- catch (Throwable t) {
- Debug.trace(t);
- return new Condition();
- }
+ return new ControlError("Attempt to throw to the nonexistent tag " +
+ tag.writeToString() + ".");
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/TypeError.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/TypeError.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/TypeError.java Fri Dec 25 09:27:34 2009
@@ -129,48 +129,37 @@
@Override
public String getMessage()
{
- // FIXME
+ final LispThread thread = LispThread.currentThread();
+ final SpecialBindingsMark mark = thread.markSpecialBindings();
+ thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
try {
- final LispThread thread = LispThread.currentThread();
- final SpecialBindingsMark mark = thread.markSpecialBindings();
- thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
- try {
- String s = super.getMessage();
- if (s != null)
- return s;
- final LispObject datum = getDatum();
- final LispObject expectedType = getExpectedType();
- FastStringBuffer sb = new FastStringBuffer();
- String name = datum != null ? datum.writeToString() : null;
- String type = null;
- if (expectedType != null)
- type = expectedType.writeToString();
- if (type != null) {
- if (name != null) {
- sb.append("The value ");
- sb.append(name);
- } else
- sb.append("Value");
- sb.append(" is not of type ");
- sb.append(type);
- } else if (name != null) {
- sb.append("Wrong type: ");
+ String s = super.getMessage();
+ if (s != null)
+ return s;
+ final LispObject datum = getDatum();
+ final LispObject expectedType = getExpectedType();
+ FastStringBuffer sb = new FastStringBuffer();
+ String name = datum != null ? datum.writeToString() : null;
+ String type = null;
+ if (expectedType != null)
+ type = expectedType.writeToString();
+ if (type != null) {
+ if (name != null) {
+ sb.append("The value ");
sb.append(name);
- }
- sb.append('.');
- return sb.toString();
- }
- catch (Throwable t) {
- // FIXME
- Debug.trace(t);
- return toString();
- }
- finally {
- thread.resetSpecialBindings(mark);
+ } else
+ sb.append("Value");
+ sb.append(" is not of type ");
+ sb.append(type);
+ } else if (name != null) {
+ sb.append("Wrong type: ");
+ sb.append(name);
}
+ sb.append('.');
+ return sb.toString();
}
- catch (Throwable t) {
- return toString();
+ finally {
+ thread.resetSpecialBindings(mark);
}
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/UnboundVariable.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/UnboundVariable.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/UnboundVariable.java Fri Dec 25 09:27:34 2009
@@ -54,12 +54,9 @@
final SpecialBindingsMark mark = thread.markSpecialBindings();
thread.bindSpecial(Symbol.PRINT_ESCAPE, T);
StringBuffer sb = new StringBuffer("The variable ");
- // FIXME
- try
- {
+ try {
sb.append(getCellName().writeToString());
- }
- catch (Throwable t) {}
+ }
finally {
thread.resetSpecialBindings(mark);
}
Modified: branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java
==============================================================================
--- branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java (original)
+++ branches/fast-boot-preloading/abcl/src/org/armedbear/lisp/WrongNumberOfArgumentsException.java Fri Dec 25 09:27:34 2009
@@ -58,12 +58,7 @@
LispObject lambdaName = operator.getLambdaName();
if (lambdaName != null && lambdaName != NIL) {
sb.append(" for ");
- try {
- sb.append(operator.getLambdaName().writeToString());
- }
- catch (Throwable t) {
- Debug.trace(t);
- }
+ sb.append(operator.getLambdaName().writeToString());
}
sb.append('.');
return sb.toString();
More information about the armedbear-cvs
mailing list