litesoft
Diff Revisions
947
vs
948
for /trunk/GWT_Sandbox/FormEngine/src/com/temp/shared/utils/ExceptionStackTracePrintStream.java
|
@@ -7,63 +7,52 @@ |
7 |
7 |
|
* {@link Throwable#printStackTrace(PrintStream)}. Only the minimally necessary |
8 |
8 |
|
* methods for this use are implemented. |
9 |
9 |
|
*/ |
10 |
|
- |
public class ExceptionStackTracePrintStream extends PrintStream |
11 |
|
- |
{ |
|
10 |
+ |
public class ExceptionStackTracePrintStream extends PrintStream { |
12 |
11 |
|
private final StringBuilder mStringBuilder = new StringBuilder(); |
13 |
12 |
|
|
14 |
|
- |
public ExceptionStackTracePrintStream() |
15 |
|
- |
{ |
|
13 |
+ |
public ExceptionStackTracePrintStream() { |
16 |
14 |
|
super( OutputStreamStub.INSTANCE ); |
17 |
15 |
|
} |
18 |
16 |
|
|
19 |
17 |
|
@Override |
20 |
|
- |
public void println( Object x ) |
21 |
|
- |
{ |
|
18 |
+ |
public void println( Object x ) { |
22 |
19 |
|
mStringBuilder.append( x ); |
23 |
20 |
|
mStringBuilder.append( "\r\n" ); |
24 |
21 |
|
} |
25 |
22 |
|
|
26 |
23 |
|
@Override |
27 |
|
- |
public void println( String x ) |
28 |
|
- |
{ |
|
24 |
+ |
public void println( String x ) { |
29 |
25 |
|
mStringBuilder.append( x ); |
30 |
26 |
|
mStringBuilder.append( "\r\n" ); |
31 |
27 |
|
} |
32 |
28 |
|
|
33 |
29 |
|
@Override |
34 |
|
- |
public String toString() |
35 |
|
- |
{ |
|
30 |
+ |
public String toString() { |
36 |
31 |
|
return mStringBuilder.toString(); |
37 |
32 |
|
} |
38 |
33 |
|
|
39 |
|
- |
private static class OutputStreamStub extends OutputStream |
40 |
|
- |
{ |
|
34 |
+ |
private static class OutputStreamStub extends OutputStream { |
41 |
35 |
|
public static final OutputStreamStub INSTANCE = new OutputStreamStub(); |
42 |
36 |
|
|
43 |
37 |
|
private static final String MESSAGE = "FIXME: this method should never be called"; |
44 |
38 |
|
|
45 |
|
- |
public void write( int b ) |
46 |
|
- |
{ |
|
39 |
+ |
public void write( int b ) { |
47 |
40 |
|
throw new AssertionError( MESSAGE ); |
48 |
41 |
|
} |
49 |
42 |
|
|
50 |
|
- |
public void write( byte[] b ) |
51 |
|
- |
{ |
|
43 |
+ |
public void write( byte[] b ) { |
52 |
44 |
|
throw new AssertionError( MESSAGE ); |
53 |
45 |
|
} |
54 |
46 |
|
|
55 |
|
- |
public void write( byte[] b, int off, int len ) |
56 |
|
- |
{ |
|
47 |
+ |
public void write( byte[] b, int off, int len ) { |
57 |
48 |
|
throw new AssertionError( MESSAGE ); |
58 |
49 |
|
} |
59 |
50 |
|
|
60 |
|
- |
public void flush() |
61 |
|
- |
{ |
|
51 |
+ |
public void flush() { |
62 |
52 |
|
throw new AssertionError( MESSAGE ); |
63 |
53 |
|
} |
64 |
54 |
|
|
65 |
|
- |
public void close() |
66 |
|
- |
{ |
|
55 |
+ |
public void close() { |
67 |
56 |
|
throw new AssertionError( MESSAGE ); |
68 |
57 |
|
} |
69 |
58 |
|
} |