Re: Checking for null parameter
- From: Lew <conrad@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 10 Jun 2008 21:19:42 -0400
pek wrote:
How do you prevent an exception? By checking if the object is null
before calling a method? How is that preventing? What will it do after
not calling the method? Inform the user for an abnormal situtation and
then close? Isn't this the same thing as if a NPE was thrown? Why even
bother? Because in any case, your code has a bug. Either way, the
program must end because the method wasn't executaded as it had to.
Sample recovery dialog:
"We're sorry, but remote document storage seems to be unavailable. Would you like to store your document locally until the remote document storage is back? (Y/n) _"
--
Lew
.
- Follow-Ups:
- Re: Checking for null parameter
- From: pek
- Re: Checking for null parameter
- References:
- Checking for null parameter
- From: pek
- Re: Checking for null parameter
- From: Lew
- Re: Checking for null parameter
- From: Tom Anderson
- Re: Checking for null parameter
- From: Lew
- Re: Checking for null parameter
- From: Tom Anderson
- Re: Checking for null parameter
- From: Lew
- Re: Checking for null parameter
- From: pek
- Re: Checking for null parameter
- From: Lew
- Re: Checking for null parameter
- From: pek
- Checking for null parameter
- Prev by Date: Re: Checking for null parameter
- Next by Date: Re: Checking for null parameter
- Previous by thread: Re: Checking for null parameter
- Next by thread: Re: Checking for null parameter
- Index(es):
Relevant Pages
|
|