Make Condition.writeToString() final, add documentation to

Condition.getMessage(), fix remaining overrides of Condition.writeToString()
to override Condition.getMessage() instead.
parent 736dff3b
......@@ -98,10 +98,10 @@ public class CellError extends LispError
}
@Override
public String writeToString()
public String getMessage()
{
if (Symbol.PRINT_ESCAPE.symbolValue() == NIL)
return super.writeToString();
return super.getMessage();
StringBuffer sb = new StringBuffer(typeOf().writeToString());
sb.append(' ');
sb.append(getCellName().writeToString());
......
......@@ -129,9 +129,13 @@ public class Condition extends StandardObject
setInstanceSlotValue(Symbol.FORMAT_ARGUMENTS, formatArguments);
}
/**
* Extending classes should override this method if they want to
* customize how they will be printed.
*/
public String getMessage()
{
return message;
return getFormatControl().toString();
}
@Override
......@@ -176,7 +180,7 @@ public class Condition extends StandardObject
}
@Override
public String writeToString()
public final String writeToString()
{
final LispThread thread = LispThread.currentThread();
if (Symbol.PRINT_ESCAPE.symbolValue(thread) == NIL)
......
......@@ -72,7 +72,7 @@ public final class EndOfFile extends StreamError
}
@Override
public String writeToString()
public String getMessage()
{
return unreadableString(Symbol.END_OF_FILE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment