配置IntelliJ Java异常断点

Jul*_* A. 0 java breakpoints exception intellij-idea conditional-statements

有没有办法配置 IntelliJ Java 异常断点,使其仅在堆栈跟踪中的底层类是特定类时触发?例如,对于下面的堆栈跟踪,我只想在底行包含 class 时中断ComputeLCAInBinaryTreeSpec

java.lang.IndexOutOfBoundsException: Index: 4, Size: 4

    at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    at java.util.ArrayList.get(ArrayList.java:429)
    at com.common.BinaryTreeNode.buildBinaryTree(BinaryTreeNode.groovy:62)
    at com.common.BinaryTreeNode.buildBinaryTree(BinaryTreeNode.groovy:76)
    at com.common.BinaryTreeNode.buildBinaryTrees_closure1(BinaryTreeNode.groovy:53)
    at groovy.lang.Closure.call(Closure.java:426)
    at com.common.BinaryTreeNode.buildBinaryTrees(BinaryTreeNode.groovy:51)
    at com.elementsofprogramminginterviews.binarytrees.ComputeLCAInBinaryTreeSpec.computes LCA of two nodes of a binary tree_closure1(ComputeLCAInBinaryTreeSpec.groovy:65)
    at groovy.lang.Closure.call(Closure.java:426)
    at groovy.lang.Closure.call(Closure.java:442)
    at com.elementsofprogramminginterviews.binarytrees.ComputeLCAInBinaryTreeSpec.computes LCA of two nodes of a binary tree(ComputeLCAInBinaryTreeSpec.groovy:47)
Run Code Online (Sandbox Code Playgroud)

Mor*_*fic 5

您应该能够在任何有条件的异常上使用中断来实现此目的。与我对另一个问题的回答类似(也许有人感兴趣),只需获取堆栈跟踪,并检查它是否包含您的类(或者它是否是层次结构中的第一个类):

状况