commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Smith" <>
Subject Re: [VOTE] RESULT XxxUtils constructors
Date Thu, 15 Aug 2002 22:27:56 GMT
On Thu, 15 Aug 2002, robert burrell donkin wrote:
> i'm not a velocity expert (i know about StringUtils because ages ago i did 
> quite a bit of source generation with texen and contributed some patches 
> to that class) but i suspect that since the  runtime type of the method 
> returns are null, it won't work.

I suppose it depends on how velocity is implemented.  If it saves the 
type information which it knows from the method call, than it should be 
able to determine the static methods and use "null" as the object ot 
execute the methods on (which is exactly how you use reflection to 
execute a static method iirc).  If, however, velocity doesn't save the 
method return typing information (possibly by just passing around the 
results from "$foo.string" rather than keeping the call info from 
$foo.string along with the return), then Paul's method won't work. 

> there are ways round this kind of thing in velocity but daniel's an expert 
> and if he says that a deprecated protected constructor is the best way to 
> allow reuse by velocity, then i - for one - am willing to accept his 
> judgement.

After thinking further it further, I can see that no matter what 
velocity's implementation is, there's probably at least a few 
implementations that aren't going to save that typing information.  So, 
having a private constructor isn't going to fly.  So, I'm changing to my 
second preference, @deprecated protected.  


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message