Kaydet (Commit) f1f6edaa authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Make LogUtils.getTrace actually work

Change-Id: I59e2b93ed1142bac22ead08cc101e27cfa3e02df
üst 56e0afab
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
package com.sun.star.script.framework.log; package com.sun.star.script.framework.log;
import java.io.ByteArrayOutputStream; import java.io.StringWriter;
import java.io.PrintStream; import java.io.PrintWriter;
public class LogUtils { public class LogUtils {
...@@ -50,27 +50,8 @@ public class LogUtils { ...@@ -50,27 +50,8 @@ public class LogUtils {
} }
public static String getTrace(Exception e) { public static String getTrace(Exception e) {
ByteArrayOutputStream baos = null; StringWriter w = new StringWriter();
PrintStream ps = null; e.printStackTrace(new PrintWriter(w));
String result = ""; return w.toString();
try {
baos = new ByteArrayOutputStream();
ps = new PrintStream(baos);
e.printStackTrace(ps);
} finally {
try {
if (baos != null) {
baos.close();
}
if (ps != null) {
ps.close();
}
} catch (Exception excp) {
}
}
return result;
} }
} }
\ No newline at 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