Al Bundy created VELOCITY-927:

             Summary: Compatibility to Velocity 1.x
                 Key: VELOCITY-927
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.2
            Reporter: Al Bundy

After updateing from a slightly outdated velocity 1.x to 2.x wo have some 
issues with our existing templates.

Some of them are already fixed in 2.2 but at least for now we still have one 

This template
    #set ( $nameMap10 =
results in 
org.apache.velocity.runtime.parser.TemplateParseException: Encountered "}" at 
test[line 3, column 5]
Was expecting one of:
    "[" ...
    "{" ...
    <WHITESPACE> ...
    <NEWLINE> ...
    "true" ...
    "false" ...
    <IDENTIFIER> ...
    "{" ...
    "[" ...
it seems that the whitespaces and newlines in this example matter.

Modifying the tempalte to
    #set ( $nameMap10 =
seems to workaround this issue but it would be nice if this would be fixed in 


Here is a small test-case:
  public void testEmptyMap()
    throws Exception
    final String _empty_map = new StringBuilder()
        .append("    #set ( $nameMap10 =\n")
        .append("    {\n")
        .append("    })\n")
      final Template _template = new Template();
StringReader(_empty_map.toString()), _template));
      final VelocityContext _context = new VelocityContext();
      _template.merge(_context, new StringWriter());

This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to