Hi Sam,

The Category.assert method caused us grief even before assert became a reserved 
keyword. Some people complained that Category.assert should abort the program in case 
of failure. Others suggested throwing an exception. As you know, the Cagegory.assert 
method (as it existed) logged an error in case of assertion failure.

In the case of log4j the use of the assert keyword is truly marginal, contrary to 
JUnit. One reasonable solution is to rename/reintroduce the assert method as 
assertLog. However, I am not sure anyone is actually using Category.assert. Regards, 
Ceki

At 16:42 06.08.2001 -0400, you wrote:
>See http://java.sun.com/j2se/1.4/docs/guide/lang/assert.html
>
>One impact of this is that methods named "assert" will be flagged as a
>compilation error.  The jakarta-log4j project simply chose to remove such a
>method.  I see that such a method is defined by httpclient - but I see no
>real usages.  So one fix might be to simply remove the method.  Another
>would be to replace the call to log4j's assert with the following:
>
>  if (!assertion) _category.error(msg);
>
>- Sam Ruby

--
Ceki Gülcü - http://qos.ch

Reply via email to