Eclipse 代码检测报 Potential null pointer access: The variable XX may be null at this location


对于这种本来是挺好的一功能,瞬间感觉好强大啊有木有,还会自动帮你检测空指针。

技术分享

可是在看别人代码,或者服务器代码的时候就蛋疼了啊!这不改编译就过不了啊!


其实如果想去掉这种检测非常简单。一个设置的问题。

Eclipse——>Window——>preferences——>java——>Compiler——>Errors/Warnings,找到下面这个选项

技术分享


看到了吗?把Error改成warning 将项目重新clean 一下。OK!

文章来自:http://blog.csdn.net/lisineng/article/details/44959975
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3