Author: byron
Date: Wed Dec 31 02:19:16 2008
New Revision: 730365
URL: http://svn.apache.org/viewvc?rev=730365&view=rev
Log:
fix to skipInvalidIterator in strict mode and also fixed bad template reporting
in #foreach directive
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java
velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity644TestCase.java
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java?rev=730365&r1=730364&r2=730365&view=diff
==============================================================================
---
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java
(original)
+++
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java
Wed Dec 31 02:19:16 2008
@@ -213,23 +213,18 @@
}
skipInvalidIterator =
rsvc.getBoolean(RuntimeConstants.SKIP_INVALID_ITERATOR, true);
-
+
if (rsvc.getBoolean(RuntimeConstants.RUNTIME_REFERENCES_STRICT, false))
{
// If we are in strict mode then the default for skipInvalidItarator
// is true. However, if the property is explicitly set, then honor
the setting.
- if (rsvc.getString(RuntimeConstants.SKIP_INVALID_ITERATOR) == null)
- {
- skipInvalidIterator = false;
- }
+ skipInvalidIterator =
rsvc.getBoolean(RuntimeConstants.SKIP_INVALID_ITERATOR, false);
}
-
-
+
/*
* this is really the only thing we can do here as everything
* else is context sensitive
*/
-
SimpleNode sn = (SimpleNode) node.jjtGetChild(0);
if (sn instanceof ASTReference)
@@ -249,7 +244,7 @@
* make an uberinfo - saves new's later on
*/
- uberInfo = new Info(context.getCurrentTemplateName(),
+ uberInfo = new Info(this.getTemplateName(),
getLine(),getColumn());
}
Modified:
velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity644TestCase.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity644TestCase.java?rev=730365&r1=730364&r2=730365&view=diff
==============================================================================
---
velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity644TestCase.java
(original)
+++
velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity644TestCase.java
Wed Dec 31 02:19:16 2008
@@ -39,7 +39,6 @@
engine.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH,
"test/templates/");
engine.setProperty(RuntimeConstants.VM_LIBRARY, "testCase644.vm");
engine.setProperty(RuntimeConstants.RUNTIME_REFERENCES_STRICT,
Boolean.TRUE);
- engine.setProperty(RuntimeConstants.SKIP_INVALID_ITERATOR,
Boolean.FALSE);
context.put("NULL", null);
}