在java中,下列行有可能(甚至0.01%)抛出NullPointerException?if(str1 == null)when throws a NullPointerException
public static void handleRequest(String str1){
if (str1 == null){ // this line throws NPE, how come !! is it a JDK1.5 bug!!
return null;
}
// other staff
}
其实我在代码中落下了一些bug和它说,上述方法行exact
抛出一个显示java.lang.NullPointerException?!
“相似的行”不会削减它。你为什么不显示确切的路线? – PhiLho 2010-05-13 20:59:34
问题仍然不符合答案,反之亦然。我没有看到接受的答案是如何回答现在编辑的问题的,这个“确切”的线。 – 2010-05-13 21:52:08