Hello,
   finally dug in and got some fixes.
   attach are the tests / patch for trunk / and patch for 1.4 release.

   Llewellyn Falco & Dan Powell
   
Index: 
Velocity/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
===================================================================
--- Velocity/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java 
(revision 289283)
+++ Velocity/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java 
(working copy)
@@ -171,11 +171,6 @@
            for (int i = 0; i < numChildren; i++)
            {
                result = jjtGetChild(i).execute(result,context);
-
-                if (result == null)
-                {
-                    return null;
-                }
            }

            return result;
@@ -262,7 +257,7 @@
         *  if value is null...
         */

-        if (value == null)
+        if (value == null || value.toString() == null)
        {
            /*
             *  write prefix twice, because it's schmoo, so the \ don't escape 
each other...
Index: Velocity/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java
===================================================================
--- Velocity/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java    
(revision 289283)
+++ Velocity/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java    
(working copy)
@@ -126,15 +126,14 @@
MethodCacheKey mck = new MethodCacheKey(paramClasses);
            IntrospectionCacheData icd =  context.icacheGet( mck );
-            Class c = o.getClass();
-
+ /*
             *  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 && icd.contextData == c )
+            if ( icd != null && (o != null && icd.contextData == o.getClass()) 
)
            {

                /*
@@ -153,12 +152,12 @@
                for (int j = 0; j < paramCount; j++)
                    params[j] = jjtGetChild(j + 1).value(context);

-                method = rsvc.getUberspect().getMethod(o, methodName, params, new 
Info("",1,1));
+                method = rsvc.getUberspect().getMethod(o, methodName, params, 
new Info(context.getCurrentTemplateName(), getLine(), getColumn()));

                if (method != null)
{ icd = new IntrospectionCacheData();
-                    icd.contextData = c;
+                    icd.contextData = o.getClass();
                    icd.thingy = method;
context.icachePut( mck, icd );
Index: 
Velocity/src/java/org/apache/velocity/util/introspection/UberspectImpl.java
===================================================================
--- Velocity/src/java/org/apache/velocity/util/introspection/UberspectImpl.java 
(revision 289283)
+++ Velocity/src/java/org/apache/velocity/util/introspection/UberspectImpl.java 
(working copy)
@@ -49,7 +49,7 @@
    /**
     *  the default Velocity introspector
     */
-    private static Introspector introspector;
+    protected static Introspector introspector;

    /**
     *  init - does nothing - we need to have setRuntimeLogger
@@ -170,7 +170,7 @@
                                                   identifier);
        }

-        return (executor != null) ? new VelGetterImpl(executor) : null;
+        return (executor.isAlive()) ? new VelGetterImpl(executor) : null;
    }

    /**

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to