IntellJ 调试器:我是否始终可以在断点处自动应用表达式?

Noo*_*oob 5 java debugging intellij-idea

IntelliJ 的调试器有什么方法可以始终:

a) 将结果设置为 true 或

b) 使 foo() 返回 true

我知道当我处于断点时我可以更改变量,但我希望它始终自动发生,而不更改代码,因为它是反编译的类。

public void foo() {
   boolean result = false;
   ..
   return result;
}
Run Code Online (Sandbox Code Playgroud)

Ego*_*gor 1

在 行上添加断点return,在断点属性中取消设置“挂起”,将“评估并记录”设置为result = true。

如果方法中有多个return,则需要修改result所有方法之前的值。

在此输入图像描述