velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nat...@esha.com>
Subject Re: catching unbound methods?
Date Sun, 13 Oct 2002 18:28:49 GMT
Mark said:
> Nathan said:
> > i suggest you RTM (read the manuals) more carefully.  looking into the
code
> > at ASTMethod.java and such is NOT the way to begin.
>
> I've read them til I'm blue in the face; they don't give any sort of
precise
> description of how reflection is applied nor what happens when lookup
fails.

my apologies if you have read them, but you must admit you were quite
mistaken about velocity accessing class members.  the user-guide section on
References (http://jakarta.apache.org/velocity/user-guide.html#References)
talks about this.  i quote, " The Property $customer.Address has the exact
same effect as using the Method $customer.getAddress(). "

to my knowledge, you are correct that the precise reflection/method lookup
algorithm is not specified.  this would probably be a good area for
improvement in the docs.

anyway, to deal more with your complaint...  again i repeat, you were wrong
to say that plain $somenull references in the templates cause errors or
warnings to be logged.   null reference errors are logged ONLY when the
$somenull or $foo.somenull reference is within a VTL directive.

now, i can see someone having cause to need or want the *option* to log
warnings when such references are encountered, but for myself, those would
just annoy me.  as it is, i am occasionally annoyed by the errors logged
when i do #set( $foo = $somenull ).   i have in the past, and will continue
to support making such VTL valid and functional (i.e. having that code set
the $foo reference to null instead of leaving it's previous value).  so, to
get to my point, i don't agree that the current behaviour is a big problem.
i was just trying to explain to you what the current behaviour is since you
seem to be confused about it.

Nathan Bubna
nathan@esha.com



--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message