01: package snow;
02:
03: import java.io.PrintWriter;
04: import java.io.StringWriter;
05:
06: /** Some basic routines.
07: */
08: public final class Basics {
09:
10: private Basics() {
11: }
12:
13: public static void ignore(Exception e) { //nopmd
14: }
15:
16: public static String exceptionToString(Throwable t) {
17: StringWriter sb = new StringWriter();
18: PrintWriter pw = new PrintWriter(sb);
19: t.printStackTrace(pw);
20: pw.flush();
21: return sb.toString();
22: }
23:
24: public static void main(String[] arguments) {
25: System.out.println("" + exceptionToString(new Throwable()));
26: }
27:
28: }
|