null checking in the extreme

Main menu:

Topics

Recent Posts

Blog

 

October 2008
M T W T F S S
« Sep   Nov »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Past Posts

Java/J2EE

JDBC

Other

Archive for October 13th, 2008

null checking in the extreme

October 13th, 2008 by Jeanne Boyarsky

In Java, we’re told to check for nulls to avoid unexpected null pointer exceptions.  This can be taken too far though.  Consider the following code: When did builder have the opportunity to become null? By definition, a constructor creates an object. We just called the constructor. We know builder isn’t null. Having extra code around [...]