public class Test {
static class MyClass {
Object o1 = null;
Object o2 = new Integer(42);
}
static Object test(boolean trap) {
MyClass obj = new MyClass();
if (trap) { }
return obj.o1;
}
public static void main(String[] args) {
for (int i = 0; i < 100_000; ++i) {
test(false);
}
}
}
The ScopeDesc for the uncommon trap in 'test' is printed like this:
ScopeDesc(pc=0x00007f52a5160144 offset=84):
Test::test@9 (line 11) reexecute=true
Locals
- l0: empty
- l1: obj[52]
Expression stack
- @0: reg rbp [10],int
Objects
- 52: Test$MyClass NULL
, stack[0],oop
There should be no newline after "NULL".