[OWASP-Washington] Java Trivia

Ed Tracy edtracy at gmail.com
Tue Jan 24 15:14:12 EST 2006


Can this cause a null pointer exception?

  if ( obj != null && obj.someMethod() != null ) { ...

I believe there is no guarantee that the compiler/optimizer will check that
obj is not null before trying to perform obj.someMethod(). If this is true,
then a null pointer may result. Thoughts?

-ed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.owasp.org/pipermail/owasp-washington/attachments/20060124/389603b2/attachment.html 


More information about the Owasp-washington mailing list