每次达到断点后,我都需要重新启动服务器吗? (Intellij,Java 11)

发布于 2025-02-03 01:37:37 字数 1399 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖乖哒 2025-02-10 01:37:38

不,断点停止了在设置并触发断点的位置捕获的stackframe中的执行。之后,您可以继续逐步逐步逐步决定是否进入给定行的执行或逐步执行(您也可以退后 - 从当前使用的方法中退出)。或者您可以跳到下一个断点。

但是,如果进行任何更改,则代码必须重新编译,并且服务器必须重新启动才能进行更改才能生效。

一种更具企业的方法是为您修补的零件编写单元测试,然后孤立地对其进行测试。
根据依赖的数量,这可能意味着毫秒至几秒钟的运行时间。看看 test-test-test-driven-develoverment

开始编写测试永远不会太晚。 )

No, a breakpoint stops the execution in the caught StackFrame at the position the breakpoint was set and triggered. After that, you can either continue stepping through manually line-by-line deciding if you either go into the execution of the given line or step over it (you can also step back - out of the method you are currently at). Or you could skip to the next breakpoint.

But if you make any changes, the code has to recompile and the server has to restart for your changes to take effect.

A more enterprise approach would be to write unit tests for the bits and pieces you tinker with and test them in isolation.
Depending on the number of dependencies it could mean runtime of milliseconds up to a couple of seconds. Take a look at Test-Driven-Development.

It is never too late to start writing tests. ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文