Reputation: 907
Is there any way in IntelliJ's debugger to always:
a) set result to true or
b) make foo() return true
I know that I can change the variable when I am in a breakpoint, but I want it to happen always and automatically, without changing the code because it is a decompiled class.
public void foo() {
boolean result = false;
..
return result;
}
Upvotes: 5
Views: 61
Reputation: 2674
Add a breakpoint on the line with return
, in breakpoint properties unset "suspend", set "evaluate and log" to result = true
.
If there are more than one return
in the method, you'll need to modify the result
value before all of them.
Upvotes: 1