Leo Sutic wrote:
>
> All,
>
> is it part of the contract for ComponentManager.release that the component
> parameter may be null?
>
> In ExcaliburComponentManager.release the method has a test at the top:
>
> if ( null == component )
> {
> return;
> }
>
> So one can write:
>
> MyComponent myComponent = null;
> try {
> myComponent = manager.lookup (MyComponent.ROLE);
> ...
> } finally {
> manager.release (myComponent);
> }
You know what? This has never been formalized as a proper use, but I like it.
I put that test in there because I wanted to exit the function early if there
was nothing to do.
I propose that we enforce this as part of the contract for ComponentManager/Selector
so that we can return a null and the manager will ignore the request.
+1
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]