Does INTELIJ Idea have such an analysis of the code that would check every instruction and directly, line by line, output (translate) all actions performed on each line? For example.

while(true) { incr++; } System.out.println("Finished"); 

Code analysis would output:

enter the while loop: increment incr increment incr ...

Now I understand where the program stops working correctly. This would help recognize which part of the code something went wrong. It turns out an endless loop. But debug is not a word about it

  • This is called debugging code, or debugging. Google it. - Ksenia
  • @Ksenia, I added a debug screenshot. It works, but when we enter an infinite loop, it cannot guess at all - Dim Diffy
  • Well, idea is intellectual, but not all-knowing) As correctly noted by @ Profesor08, idea automatically highlights blocks like while (true) in yellow, indicating an endless loop in the description. But you have a calculated value instead of true in the screenshot, and if idea did not underline this line, then the compiler cannot know whether this cycle will be infinite. If idea were so clever, programmers would not be needed :) - Ksenia
  • So again, all with their own hands ...) Understood, thanks) - Dim Diffy

1 answer 1

Yes, there is, run the program in debug mode, so you will have access to additional controls, where you can walk through the program as you like.

As far as I know, idea automatically highlights similar blocks in yellow, indicating an endless loop in the description. It also finds recursions, which can also cause a hang.