Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e9a6e23

Browse files
committed
优化"how-can-i-convert-a-stack-trace-to-a-string"
1 parent b70ff66 commit e9a6e23

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ stackoverflow-Java-top-qa
6969
* [如何创建单例](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/What_is_an_efficient_way_to_implement_a_singleton_in_Java.md)
7070
* [实现Runnable接口 VS. 继承Thread类](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/implements-runnable-vs-extends-thread.md)
7171
* [我应该用哪一个@NotNull注解](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/which-notnull-java-annotation-should-i-use.md)
72+
* [怎样将堆栈追踪信息转换为字符串](https://github.com/giantray/stackoverflow-java-top-qa/blob/master/contents/how-can-i-convert-a-stack-trace-to-a-string.md)
7273

7374

7475
> 网络
@@ -108,7 +109,6 @@ stackoverflow-Java-top-qa
108109
- [Comparing Java enum members: == or equals()?](http://stackoverflow.com/questions/1750435/comparing-java-enum-members-or-equals)
109110
- [Failed to load the JNI shared Library (JDK)](http://stackoverflow.com/questions/7352493/failed-to-load-the-jni-shared-library-jdk)
110111
- [How to create a Java String from the contents of a file?](http://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-the-contents-of-a-file)
111-
- [How can I convert a stack trace to a string?](http://stackoverflow.com/questions/1149703/how-can-i-convert-a-stack-trace-to-a-string)
112112
- [How do you assert that a certain exception is thrown in JUnit 4 tests?](http://stackoverflow.com/questions/156503/how-do-you-assert-that-a-certain-exception-is-thrown-in-junit-4-tests)
113113
- [What exactly is Apache Camel?](http://stackoverflow.com/questions/8845186/what-exactly-is-apache-camel)
114114
- [How can I permanently have line numbers in IntelliJ?](http://stackoverflow.com/questions/13751/how-can-i-permanently-have-line-numbers-in-intellij)

‎contents/how-can-i-convert-a-stack-trace-to-a-string.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#怎么样将堆栈追踪信息转换为字符串类型
1+
#怎样将堆栈追踪信息转换为字符串
22
##问题
33
`Throwable.getStackTrace()`的结果转换为一个字符串来来描述堆栈信息的最简单的方法是什么
44

@@ -8,7 +8,7 @@
88
[`org.apache.commons.lang.exception.ExceptionUtils.getStackTrace(Throwable)`](org.apache.commons.lang.exception.ExceptionUtils.getStackTrace\(Throwable\))
99

1010
###答案二
11-
[`Throwable.printStackTrace(PrintWriter pw)`](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace-java.io.PrintWriter-)将对堆栈信息发送到一个输出中:
11+
[`Throwable.printStackTrace(PrintWriter pw)`](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace-java.io.PrintWriter-)可以输出堆栈信息:
1212
````java
1313
StringWriter sw = new StringWriter();
1414
PrintWriter pw = new PrintWriter(sw);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /