I am currently using IntelliJ IDEA for Java development, but I am also interested in answers targeting other IDEs or general concepts for debugging Java code. Since this is a feature that I missed in a number of IDEs, I'm not sure if I missed the concept of a workflow while transferring my debugging habits from other languages.
Say I'm writing code in myapp.* Using the framework classes from somelib.* . A typical stack trace can start in any packet and can switch between them several times. Let them also say that I am debugging the assumption that there are errors in my code and that there is no library in the code. An example of a stack trace (showing only class names):
somelib.D (current stack frame) somelib.C myapp.Y myapp.X somelib.B somelib.A
Usually, I am not interested in the following types of exceptions and do not want the debugger to break them into:
Thrown in somelib.B and caught in somelib.A . Either the library code throws exceptions to handle the problem state inside the library, or to stop the application. In the latter case, I am interested in the exception message, which I hope tells me what is wrong.
Thrown in somelib.D and caught in somelib.C . The library code can use exceptions as a form of logic in which a certain action is used, and an alternative route is taken in case of a problem or when my code is notified about the problem in other ways (for example, returns a null reference if necessary).
Types of exceptions that interest me:
It is somelib.C into somelib.C or somelib.D and misses into somelib.C or somelib.D . Here I want the debugger to myapp.Y into a line in myapp.Y , where I call the code from somelib.C .
Thrown in myapp.X or myapp.Y , either caught or not displayed. Here I want the debugger to break into the line where the exception was sent.
IntelliJ IDEA gives me choices, I want to break the caught or uncaught exceptions, or both, and limit the place where the exception is selected for a set of classes. These options do not help, since I usually want to catch any exception, to be caught or not displayed, while the code that I wrote is between the place that he chose and the place that he caught in the end.
java debugging intellij-idea exception
Feuermurmel
source share