Charles Miller
Posts: 1014
Nickname: carlfish
Registered: Feb, 2003
|
Charles Miller is a Java nerd with a weblog
|
|
|
|
JSR-666 Extension: Exception Types
|
Posted: Feb 12, 2008 10:06 PM
|
|
When checking preconditions in Java code, it is very common to check whether some method argument is null, and throw an exception if it is. There are two equally valid exceptions that may be used in this case: IllegalArgumentException and NullPointerException. The decision to use one over the other is often the cause of holy wars, and can consume a great deal of productivity on internal mailing-lists and blogs. (245 Words)
Read: JSR-666 Extension: Exception Types
|
|