How to watch for NullPointerEx in Eclipse using Debbuger Add Watch Expression feature?

旧城冷巷雨未停 提交于 2020-01-17 05:01:25

问题


Hi how can I use that Add Watch Expression of eclipse to watch for any NullPointerExceptions 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!