I have function foo() that returns true/false/null.
I have this piece of code:
Boolean flag = foo();
if (flag != null){
.....
}
When inspecting the if statement, I get the following exception: java.lang.NullPointerException at booleanValue()
Seems that it tries to evaluate its primitive value and compare it . However, this is what I do NOT want it to do. I want to check whether it is initialized...
Any ideas?
Thanks
booleanValue()doesn't appear in your code, could it relate to this debugger method: java.sun.com/j2se/1.5.0/docs/guide/jpda/jdi/com/sun/jdi/…