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

Appearance settings

Latest commit

 

History

History
History
41 lines (35 loc) · 1.07 KB

File metadata and controls

41 lines (35 loc) · 1.07 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import java.util.Set;
import static java.lang.StackWalker.Option.RETAIN_CLASS_REFERENCE;
import static java.lang.StackWalker.Option.SHOW_HIDDEN_FRAMES;
/**
* Created by mtumilowicz on 2019-02-18.
*/
class StackWalking {
void m1() {
m2();
}
private void m2() {
m3();
}
private void m3() {
System.out.println("---");
System.out.println("stack from m3():");
StackWalker.getInstance(Set.of(RETAIN_CLASS_REFERENCE, SHOW_HIDDEN_FRAMES), 4)
.walk(frames -> {
frames.limit(4).forEach(System.out::println);
return null;
});
System.out.println("---");
m4();
}
private void m4() {
System.out.println("---");
System.out.println("stack from m4():");
StackWalker.getInstance(Set.of(RETAIN_CLASS_REFERENCE, SHOW_HIDDEN_FRAMES), 5)
.walk(frames -> {
frames.limit(5).forEach(System.out::println);
return null;
});
System.out.println("---");
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.