The String
representation includes the name of the class,
the descriptive comment (if any),
and the String
representation of the cause
Throwable
(if any).
// calculate approximate size of the String to return
StringBuffer sb = new StringBuffer();
sb.append (super.toString());
// include cause Throwable information
if (cause != null) {
sb.append("\n"); //NOI18N
sb.append("Nested exception"); //NOI18N
sb.append("\n"); //NOI18N
sb.append(cause.toString());
}
return sb.toString();