When debugging in IntelliJ IDEA, how do I prevent variables from being affected while the thread is suspended?

Viewed 89

Sorry for the confusing titles but I confused on the issue at hand.

Currently when I run my simple program through the debugger, as I step through the program the variables that were just set are changed to null. This then affects the rest of the lines I am stepping through.

When running the program regularly it works perfectly normal and as expected. It's almost as if java is collecting it as garbage while the program is suspended in debug and when it runs normally, the active use of the variables prevents this.

Step 1:

enter image description here

Step 2:

enter image description here

1 Answers

Disable Settings (Preferences on macOS) | Build, Execution, Deployment | Debugger | Data Views | Java | Enable 'toString()' object view.

Related