IntelliJ 的调试器中是否有任何方法可以始终:
a) 将结果设置为 true 或
b) 使 foo() 返回 true
我知道我可以在断点时更改变量,但我希望它始终自动发生,而不更改代码,因为它是一个反编译的类。
public void foo() {
boolean result = false;
..
return result;
}
最佳答案
在 return
行上添加断点, 在断点属性中未设置“暂停”,将“评估和记录”设置为 result = true
.
如果有多个 return
在方法中,您需要修改 result
在他们所有人之前的值(value)。
关于java - IntelliJ 调试器 : Can I always apply an expression automatically at a breakpoint?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58627167/