Sylvain Wallez wrote:

> 
>>We already have an ExceptionUtil in org.apache.avalon.framework.ExceptionUtil.
>>I would prefer adding a couple signatures:
>>
>>/** two member version will set the first variable if not set, or throw exception */
>>ExceptionUtil.check(this.manager, manager, "Manager already set");
>>
>>/** one member version used for state checking */
>>ExceptionUtil.check(this.isInitialized, "Component not initialized");
>>
> 
> That's nice : it avoids an additional class and the associated import,
> but "check" may be to imprecise in the context of "ExceptionUtil". So
> what about something like "checkImmutable()" for the first one ? The
> second is a simple assertion, so what about an "assertTrue()" (until the
> whole world uses JDK 1.4) ?



Actually I started a ComponentUtil to assist in the process.  The ComponentUtil
uses a long with bit flags to test if it is legal to perform the verious
operations.

It will be helpful, and I think it belongs in Framework.  What do you all
think?





-- 

"Those who would trade liberty for
  temporary security deserve neither"
                 - Benjamin Franklin


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to