It is not a consistent behaviour.
Whether you interpolate ## and #* and *# INSIDE the double-quoted string (hence,
"##foo"==""), whether you don't interpolate comments inside strings at all. And
I strongly recomend the latter : that's the standard behaviour in all other
languages I know of.
Right now, with 1.5-dev, I've got:
[2004/11/16 03:05:10.405] Velocity [error] Error in interpolating string
literal : java.lang.StringIndexOutOfBoundsException: String index out of range: -1
with no information about the location and no stacktrace... (it seems like a new
bug appeared in the handling of the so-called lexical error)
I put it back as a bug rather than as an enhancement, at least because Velocity
should display something like "unterminated string at line...".