-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathactive-debug-code.test.java
More file actions
44 lines (33 loc) · 1.06 KB
/
active-debug-code.test.java
File metadata and controls
44 lines (33 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
public class ActiveDebugCode{
public void bad(){
StackTraceElement[] elements;
Exception e = new Exception();
elements = e.getStackTrace();
// <expect-error>
System.err.print(elements);
}
public void bad2(){
StackTraceElement[] elements;
elements = Thread.currentThread().getStackTrace();
// <expect-error>
System.err.print(elements);
}
public void bad3(){
StackTraceElement[] elements;
elements = new Throwable().getStackTrace();
// <expect-error>
System.err.print(elements);
}
public void bad4(){
// <expect-error>
System.out.println(org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e));
// <expect-error>
System.out.println(org.apache.commons.lang3.exception.ExceptionUtils.getFullStackTrace(e));
}
public void alsobad(){
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
// <expect-error>
System.out.println(ste);
}
}
}