velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r737544 - in /velocity/engine/branches/1.6.x/src: changes/changes.xml java/org/apache/velocity/runtime/directive/Evaluate.java
Date Sun, 25 Jan 2009 17:42:09 GMT
Author: nbubna
Date: Sun Jan 25 17:42:08 2009
New Revision: 737544

URL: http://svn.apache.org/viewvc?rev=737544&view=rev
Log:
VELOCITY-682 merge inline macro/#evaluate fix from 737465

Modified:
    velocity/engine/branches/1.6.x/src/changes/changes.xml
    velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Evaluate.java

Modified: velocity/engine/branches/1.6.x/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/velocity/engine/branches/1.6.x/src/changes/changes.xml?rev=737544&r1=737543&r2=737544&view=diff
==============================================================================
--- velocity/engine/branches/1.6.x/src/changes/changes.xml (original)
+++ velocity/engine/branches/1.6.x/src/changes/changes.xml Sun Jan 25 17:42:08 2009
@@ -28,6 +28,10 @@
 
     <release version="1.6.2" date="2009-01-28">
 
+      <action type="fix" dev="nbubna" issue="VELOCITY-682">
+        Fix loss of inline macros when #evaluate is used.
+      </action>
+
       <action type="fix" dev="nbubna" issue="VELOCITY-554" due-to="Adrian Tarau">
         Fix name of sources jar for maven deployment.
       </action>

Modified: velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Evaluate.java
URL: http://svn.apache.org/viewvc/velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Evaluate.java?rev=737544&r1=737543&r2=737544&view=diff
==============================================================================
--- velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Evaluate.java
(original)
+++ velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Evaluate.java
Sun Jan 25 17:42:08 2009
@@ -20,6 +20,7 @@
  */
 
 import java.io.IOException;
+import java.io.StringReader;
 import java.io.Writer;
 
 import org.apache.velocity.context.EvaluateContext;
@@ -37,7 +38,7 @@
 import org.apache.velocity.util.introspection.Info;
 
 /**
- * Evaluates the macro argument as a Velocity string, using the existing
+ * Evaluates the directive argument as a VTL string, using the existing
  * context.
  *
  * @author <a href="mailto:wglass@apache.org">Will Glass-Husain</a>
@@ -157,7 +158,7 @@
 
         try
         {
-            nodeTree = rsvc.parse(sourceText, templateName);
+            nodeTree = rsvc.parse(new StringReader(sourceText), templateName, false);
         }
         catch (ParseException pex)
         {
@@ -178,8 +179,7 @@
 
         if (nodeTree != null)
         {
-            InternalContextAdapterImpl ica =
-                new InternalContextAdapterImpl( new EvaluateContext(context, rsvc) );
+            InternalContextAdapter ica = new EvaluateContext(context, rsvc);
 
             ica.pushCurrentTemplateName( templateName );
 



Mime
View raw message