Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA debugger for Java: return desirable value from method during debug

In Eclipse there is feature "Force return" which allows to return any selected object from method call. Is there such feature in IntelliJ IDEA?

like image 924
EvilOrange Avatar asked Oct 08 '14 20:10

EvilOrange


People also ask

How do I change the value in debug mode in Intellij?

Select a variable or a property of a complex object in the Debug window, press F2 or right-click and choose Set Value... from the context menu, and then specify a new value and press Enter .

How do I Debug a method in Intellij?

Run the program in debug mode Click the Run icon in the gutter, then select Modify Run Configuration. Enter arguments in the Program arguments field. Click the Run button near the main method. From the menu, select Debug.


1 Answers

Yes, there is. This feature was introduced in IntelliJ IDEA 15. When debugging, open the debugger window, select the frames tab (beside threads) then right click on a frame/method in the list and select "Force Return" and supply the value.

like image 121
Adam Rehill Avatar answered Oct 17 '22 09:10

Adam Rehill