geirm 01/04/01 18:15:18
Modified: src/java/org/apache/velocity/texen Generator.java
Log:
Small fix submitted by John McNally to prevent iterative calls to parse
from accumulating introspection cache data, as torque was using texan
with the caching off - so the template would be 'new' on each iteration,
so the VelContext would accumulate fresh introspection info for each
iteration.
I think that it should also be in the other template.merge() location in
parse() as well, but someone clueful in Texen should look at it (jason :)
Revision Changes Path
1.15 +5 -2
jakarta-velocity/src/java/org/apache/velocity/texen/Generator.java
Index: Generator.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/texen/Generator.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Generator.java 2001/03/23 16:05:36 1.14
+++ Generator.java 2001/04/02 01:15:18 1.15
@@ -68,6 +68,7 @@
import org.apache.velocity.Template;
import org.apache.velocity.context.Context;
+import org.apache.velocity.VelocityContext;
import org.apache.velocity.runtime.Runtime;
/**
@@ -75,7 +76,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Leon Messerschmidt</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
- * @version $Id: Generator.java,v 1.14 2001/03/23 16:05:36 jvanzyl Exp $
+ * @version $Id: Generator.java,v 1.15 2001/04/02 01:15:18 geirm Exp $
*/
public class Generator
{
@@ -315,7 +316,9 @@
fileWriter = (FileWriter) fileWriters.get(outputFile);
}
- template.merge (controlContext,fileWriter);
+ VelocityContext vc = new VelocityContext( controlContext );
+ template.merge (vc,fileWriter);
+
//fw.close();
return "";