Index: ./src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java
===================================================================
RCS file: /home/cvspublic/jakarta-velocity/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java,v
retrieving revision 1.17
diff -u -r1.17 ASTMethod.java
--- ./src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java	2001/05/20 19:50:05	1.17
+++ ./src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java	2001/07/26 17:32:19
@@ -55,7 +55,7 @@
  */
 
 import java.lang.reflect.Method;
-
+import java.lang.reflect.Modifier;
 import java.io.*;
 
 import org.apache.velocity.context.InternalContextAdapter;
@@ -247,6 +247,17 @@
 
         try
         {
+            /* It is not authorized to access a public method via
+             * the original class. Normally it should be via the
+             * interface that was returned via the call that sent
+             * the object. So just make sure it will be accessible
+             * and do not open a security hole.
+             */
+            int modifiers = method.getModifiers();
+            if ( Modifier.isPublic(modifiers) && !method.isAccessible() ){
+                method.setAccessible(true);
+            }
+            
             /*
              *  get the returned object.  It may be null, and that is
              *  valid for something declared with a void return type.
@@ -255,7 +266,6 @@
              *  String so ASTReference() correctly figures out that
              *  all is well.
              */
-
             Object obj = method.invoke(o, params);
             
             if (obj == null)
@@ -314,10 +324,14 @@
         }
         catch( Exception e )
         {
+            synchronized(System.out){
             System.out.println("ASTMethod.execute() : exception invoking method '" 
                                + methodName + "' in " + o.getClass() + " : "  + e );
+            e.printStackTrace(System.out);
+                    }
                                
             return null;
         }            
     }
 }
+

The command completed successfully.
