- summary: --> EventFormat cast exception
Hello!
There's a bug in Grace 0.7.3
Let's look at EventFormat.java:formatObject()
protected void formatObject(
StringBuffer buffer,
String format,
String message,
Object object)
{
if (object instanceof Throwable) {
formatException(buffer, (Exception) object);
}
else {
formatGenericObject(buffer, format, message, object);
}
}
This code causes ClassCastException when formatting an object of
Throwable class (Throwable cannot be casted to Exception).
I think that formatException(...) should take Throwable (not
Exception) as second parameter. So the code of formatObject() will be
like that:
protected void formatObject(
StringBuffer buffer,
String format,
String message,
Object object)
{
if (object instanceof Throwable) {
formatException(buffer, (Throwable) object);
// ^^^^^^^^^^
}
else {
formatGenericObject(buffer, format, message, object);
}
}
With best regards,
Stanislav Markin, Russia mailto:stas@uw.ru