{
/*
* check the cache
*/
MethodCacheKey mck = new MethodCacheKey(methodName, paramClasses);
IntrospectionCacheData icd = context.icacheGet(mck);
/*
* like ASTIdentifier, if we have cache information, and the Class of
* Object o is the same as that in the cache, we are safe.
*/
if (icd != null && (o != null && icd.contextData == o.getClass()))
{
/*
* get the method from the cache
*/
method = (VelMethod) icd.thingy;
}
else
{
/*
* otherwise, do the introspection, and then cache it
*/
method = VelocityUtil.getEngine().getRuntimeServices().getUberspect().getMethod(o, methodName, params,
new Info(node.getTemplateName(), node.getLine(), node.getColumn()));
if ((method != null) && (o != null))
{
icd = new IntrospectionCacheData();
icd.contextData = o.getClass();
icd.thingy = method;
context.icachePut(mck, icd);
}