Yes. There was a clear decision to allow it so one could write:
MyComponent comp = null;
try {
comp = mgr.lookup (...);
....
} finally {
mgr.release (comp);
}
without having to put in a null check.
/LS
> -----Original Message-----
> From: Marcus Crafter [mailto:[EMAIL PROTECTED]
> Sent: den 15 oktober 2003 17:46
> To: [EMAIL PROTECTED]
> Subject: Safe to release null?
>
>
> Hi All,
>
> Hope all is going well!
>
> Just wanted to ask a quick question. Is it actually
> considered safe to release null?
>
> The framework API doesn't mention it, but I've noticed that
> both ECM and Fortress have code in their
> ServiceManager.release() implementations that can handle
> receiving a null reference.
>
> Is this feature more of a safety net, or was there previously
> a clear decision to allow null to be released?
>
> Cheers,
>
> Marcus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]