hello Mark,

On Sunday 30 July 2006 02:54, Mark Wielaard wrote:
> On Sat, 2006-07-29 at 05:25 +1000, Raif S. Naffah wrote:
> > 60. WARNING in ./gnu/classpath/tools/javah/JniHelper.java
> >  (at line 77)
> >         assert type.getSort() == Type.OBJECT;
> >         ^^^^^^
> > 'assert' should not be used as an identifier, since it is a reserved
> > keyword from source level 1.4 on
>
> Also note that this is a "dangerous" usage of assert. Inside the assert
> statement it does both a variable dereference, which could throw, and
> a method call, which might have all kinds of side-effects. That means
> that the code could execute completely different based on whether or not
> assertions are enabled or not.

concur.

i personally found the guidelines here 
(http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html#usage) valuable 
for deciding when to use, or not, assertions.


cheers;
rsn

Attachment: pgp463fRBzfRV.pgp
Description: PGP signature

Reply via email to