Unexpected template parsing issue

Christopher Schultz <[email protected]> Thu, 29 Aug 2013 13:55:47 -0400
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <[email protected]>
All,

Velocity 1.7, Oracle JDK 1.7.0_25

I found something odd recently and was able to reduce it to this simple
test-case:

$foo##
$foo.bar##
$foo.bar.baz##

Expected output (with foo=null):

$foo$foo.bar$foo.bar.baz

Actual output:
$foo$foo.bar##
$foo.bar.baz##

Using {..} around the references makes this example work the way I had
expected. Also, adding spaced /before/ the ## at the end of the lines
makes the output look as I had expected.

Another data point:

$foo${foo.bar}##
$foo.bar.baz}##

(Note trailing } after "baz").

Yields:

$foo${foo.bar}$foo.bar.baz}

I've been using ## at the end of lines where I want to avoid a newline
in the output for a while... I just noticed this case recently. Is this
something that /should/ work the way I expect, or am I abusing Velocity
in this way?

Thanks,
-chris
signature.asc (application/pgp-signature, 938 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSH4sjAAoJEBzwKT+lPKRYDUEP/1uIhO5ufv+doIzAK6TZwyOT
XTEvTt4qBqluEcBJFWdLlIYV837p75MsrKwkLhB6oJJM/HAfr7MUICgwYB/1ShRE
6giiSJZxNXbZkZ4Lk4+oHDHUVS9TP0YtRMrxFkoFauk9b1L0TFScEm+wBG995zMD
jOzIDFI3GFzgZZ3vSWdspVjWlBpJkfBLMNevIOL/CjSybXoDtjSKKQOFp9oBmnl1
CNKmCIazVhbJNo0GPI9esNwURtCUw46knSGqwaJhdb8WvQL/mrFRtdzRLX7bhkxr
NnUUv9GJNzlbHMSi4+lImPAT4p2fDRk3WtsNaKB5RbaYwOIJ1pFuz7QxG3rdP8ld
WW055+Riq2xr4T71sI+XjtC3nkLppB/GF3eCsZJ0yt6iym6QBZIPwdIbf2Ar8rYt
YyXFeWzn5nVZ1/cHedTNCx6CQFP4mxxRRSNyTf6C9v3obB9LajPm37fLkMzQyeA+
V15oL9IzwyTFHTTgBbJtWrVixfyh1ga6IA84j2ytdDWVdLg9uyDluJK7pHkh/06K
o/xh5OJjNqFWU6IsTqqC2lpsscL5LWyWbXTAnE1dxYjI3J+GWWHIIXnVhrDJ/f4N
Hawq34R18GRROxZPNkMzgPoKMYFfvXlS62guIXNdLCQfW84PV7iBekzGVVFrsSnW
N6G9nCUFt3Pa5ZWJUhbV
=aQRk
-----END PGP SIGNATURE-----