Hi all,
I am now using Apache Velocity 1.4 in my project. I would like to
incorporate the escaping HTML feature in my project without bringing in
Velocity 1.5. I could find that there is a tool called EscapeTool to achieve
it. But to do that, i need to change all my velocity templates to enclose
Based on several articles about synchronization (Doug Lea) you need
volatile when a thread needs to read the array.
Look also at CopyOnWriteArrayList : any changes is performed under a
synchronized block and any read is performed under volatile
constraints(synchronization with main memory). Not
Of course the modification proposed here is not thread safe in its current form.
Jon.
On 7/30/08, Adrian Tarau <[EMAIL PROTECTED]> wrote:
> The best way to implement listeners (as you may see in
> EventListenerList) is to work with arrays.They are immutable and have
> the lowest memory footprint(
Use of synchronized will solve the thread safety issue I was concerned
about. I am not sure that a volatile declaration adds anything in this
case, since the synchronized declaration is a stronger declaration
than volatile [ e.g. synchronized implies volatile from the
perspective of threads that sy
You're right, but I've sent a correction after that : adding
synchronized to addListener and removeListener.
Adding synchronized keyword guarantees atomic modifications of listners
array and provides visibility(by committing changes in main memory)
for listeners to other threads. Also listen
[
https://issues.apache.org/jira/browse/VELOCITY-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618954#action_12618954
]
wyla edited comment on VELOCITY-607 at 8/1/08 1:41 AM:
---
[
https://issues.apache.org/jira/browse/VELOCITY-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jarkko Viinamäki updated VELOCITY-607:
--
Attachment: (was: velocity-1.6-dev-macro-performance-IDEAS-v2.patch)
> Runtime ma
[
https://issues.apache.org/jira/browse/VELOCITY-607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jarkko Viinamäki updated VELOCITY-607:
--
Attachment: velocity-1.6-dev-macro-performance-IDEAS-v2.1.patch
Some cleanup and Java