Timeline for What's the best way to avoid lots of "if (obj != null)" in Java code?
Current License: CC BY-SA 2.5
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 29, 2010 at 16:11 | comment | added | Matt Warren | @Robin, yeah it has some limits, but it does beat getting NullReferenceExceptions!! | |
| Jul 29, 2010 at 14:42 | comment | added | Robin | Although good in some situations, I find it is fairly limited in real world usage. | |
| Jul 29, 2010 at 14:39 | comment | added | Carl Manaster | +1. Empty collections are almost a special case of this - you just don't need to write a class for them. But the pattern of handing around something that isn't null and behaves safely is the same. | |
| Jul 29, 2010 at 14:38 | history | edited | Carl Manaster | CC BY-SA 2.5 | typo |
| Jul 29, 2010 at 14:36 | history | answered | Matt Warren | CC BY-SA 2.5 |