I have a list in which the first element is null
. IntelliJ debugger correctly shows the list size as 5, but it shows only 1,2,3,4 elements. It would be nice to see that element with the index 0 is null
(it took me some time to figure out my problems while debugging because it did not show that). Is it possible to force IntelliJ to show this?
Here is a screenshot, where the size is 5 and the elements shown are only 1-4 because the first element is null
:
If the code is outdated, or the versions (the source code and the compiled class) mismatch in any way, it can happen that the debugged is giving the IDE information to show a certain line, but that information is not correct giving the current source code, which might cause what appears to be the debugged "jumping" ...
You can click on the Run icon in the gutter area and select the Debug option. You can invoke context actions on the class or main method by using Alt+Enter and choose the Debug action. You can also start it from the Run menu, or by pressing Shift F9.
To do this, go to Settings/Preferences | Build, Execution, Deployment | Debugger and select Drag to the editor or click with middle mouse button. Clicking a breakpoint will then enable or disable it.
The debugger is a powerful tool, which lets you find bugs a lot faster by providing an insight into the internal operations of a program. This is possible by pausing the execution and analyzing the state of the program by thorough examination of variables and how they are changed line by line.
Null array elements are hidden by default, you can disable it here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With