Previously we deleted horizontal whitespace between a $reference and a following #set, and all whitespace between a #directive and a following #set. But this was wrong (meaning, not the way Apache Velocity does it). We should only ever delete horizontal whitespace before a #set, whether preceded by a $reference or a #directive. The confusion arose because a single newline is deleted after a #directive, and then what remains before the #set may indeed only be horizontal whitespace.
Also fix a bug in TemplateTest where the same VelocityEngine instance was being used for multiple compare calls in the same test method. That was not right, because macros defined in one call persisted until the next and were not overridden by definitions of the same name.
RELNOTES=A bug with space deletion before #set has been fixed, to be more like Apache Velocity.
Improve handling of space-deletion before
#set
.Previously we deleted horizontal whitespace between a
$reference
and a following#set
, and all whitespace between a#directive
and a following#set
. But this was wrong (meaning, not the way Apache Velocity does it). We should only ever delete horizontal whitespace before a#set
, whether preceded by a$reference
or a#directive
. The confusion arose because a single newline is deleted after a#directive
, and then what remains before the#set
may indeed only be horizontal whitespace.Also fix a bug in
TemplateTest
where the sameVelocityEngine
instance was being used for multiplecompare
calls in the same test method. That was not right, because macros defined in one call persisted until the next and were not overridden by definitions of the same name.RELNOTES=A bug with space deletion before
#set
has been fixed, to be more like Apache Velocity.