问题
Hi how can I use that Add Watch Expression of eclipse to watch for any NullPointerException
s that my application can throw ?
I saw a Guy once adding some code into that feature and with that he made eclipse debugger to stop when any NullpointerEx was "born".
I would like to learn how to do that.
回答1:
You don't use 'watch expression'. Go to the "breakpoints" view and add an exception breakpoint for NullPointerException
.
回答2:
I don't know how to do this using Add Watch Expression, but you can set breakpoints on certain types of exceptions being thrown. Perhaps this is what you're looking for?
来源:https://stackoverflow.com/questions/4809646/how-to-watch-for-nullpointerex-in-eclipse-using-debbuger-add-watch-expression-fe