Author: nbubna
Date: Tue Apr 27 22:19:26 2010
New Revision: 938699
URL: http://svn.apache.org/viewvc?rev=938699&view=rev
Log:
VELOCITY-717 don't add blocked inputs to macro libraries
Modified:
velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Parse.java
Modified:
velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Parse.java
URL:
http://svn.apache.org/viewvc/velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Parse.java?rev=938699&r1=938698&r2=938699&view=diff
==============================================================================
---
velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Parse.java
(original)
+++
velocity/engine/branches/1.6.x/src/java/org/apache/velocity/runtime/directive/Parse.java
Tue Apr 27 22:19:26 2010
@@ -233,22 +233,25 @@ public class Parse extends InputBase
throw new VelocityException(msg, e);
}
- /**
- * Add the template name to the macro libraries list
- */
- List macroLibraries = context.getMacroLibraries();
-
- /**
- * if macroLibraries are not set create a new one
- */
- if (macroLibraries == null)
+ if (!blockinput)
{
- macroLibraries = new ArrayList();
- }
+ /**
+ * Add the template name to the macro libraries list
+ */
+ List macroLibraries = context.getMacroLibraries();
+
+ /**
+ * if macroLibraries are not set create a new one
+ */
+ if (macroLibraries == null)
+ {
+ macroLibraries = new ArrayList();
+ }
- context.setMacroLibraries(macroLibraries);
+ context.setMacroLibraries(macroLibraries);
- macroLibraries.add(arg);
+ macroLibraries.add(arg);
+ }
/*
* and render it