Here's a patch for Velocity 2.0 trunk which implements the change Nathan described i.e. macros are not stored centrally but rather kept within templates. It fixes VELOCITY-776.

This patch also improves pom.xml to hook JavaCC plugin automatically to the build process, removes a lot of unnecessary code, adds new test cases etc. There are also several internal interface changes (should not affect any Velocity users though).

All tests pass but these rather radical changes have not been tested otherwise. Careful review is needed.

Jarkko Viinamäki
added a comment - 15/Mar/12 23:53 Here's a patch for Velocity 2.0 trunk which implements the change Nathan described i.e. macros are not stored centrally but rather kept within templates. It fixes VELOCITY-776 .
This patch also improves pom.xml to hook JavaCC plugin automatically to the build process, removes a lot of unnecessary code, adds new test cases etc. There are also several internal interface changes (should not affect any Velocity users though).
All tests pass but these rather radical changes have not been tested otherwise. Careful review is needed.

Hi Nathan. Maybe I'll get later back to you about that. I like the fact though that someone reviews big patches so even if I could commit changes straight to SVN, I probably wouldn't do it without review iteration.

I noticed that I forgot to update some of the JavaDocs and did some cleanup here and there. I'll update the patch soon.

I also started to run Velocity 2.0 on my performance test bench. I checked out clean version of Velocity 2.0 SVN head (so without any of these changes) and guess what... it is 30%+ slower than Velocity 1.7. I think that's pretty bad so there's definitely a need to do some performance optimization.

Jarkko Viinamäki
added a comment - 17/Mar/12 14:36 Hi Nathan. Maybe I'll get later back to you about that. I like the fact though that someone reviews big patches so even if I could commit changes straight to SVN, I probably wouldn't do it without review iteration.
I noticed that I forgot to update some of the JavaDocs and did some cleanup here and there. I'll update the patch soon.
I also started to run Velocity 2.0 on my performance test bench. I checked out clean version of Velocity 2.0 SVN head (so without any of these changes) and guess what... it is 30%+ slower than Velocity 1.7. I think that's pretty bad so there's definitely a need to do some performance optimization.