Could produce NullPointer??
Code inspection says a nullpointer could be thrown at the comment....maybe my brain just isn't working?
private static boolean areSame(Object one, Object two){
if(one == null ^ two == null)
return false;
if(one == null && two == null)
return true;
return one.equals(two); //nullpointer here?
}
Please sign in to leave a comment.
Didn't seem so to my eyes.
Output from simple test:
areSame - null , null: true
areSame - null , x: false
areSame - x , null: false
areSame - x , x: true
areSame - x , y: false
No npe thrown.
that is what i thought, but idea outsmarts me sometimes :)
Yes, this seems a bug, if my brains works right not having its usual cup of
coffee:))
"charles decroes" <spam@decroes.com> wrote in message
news:29319089.1059697325741.JavaMail.javamailuser@localhost...
my brain just isn't working?
>
>
>
>