Skip to content

Commit

Permalink
'SPR-9319 Made non thread safe method getTemplate(String name, Locale…
Browse files Browse the repository at this point in the history
… locale) in FreeMarkerView synchronized'
  • Loading branch information
yegorch committed Mar 15, 2013
1 parent 4812c18 commit 16b4cbb
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -345,9 +345,13 @@ protected Template getTemplate(Locale locale) throws IOException {
* @throws IOException if the template file could not be retrieved
*/
protected Template getTemplate(String name, Locale locale) throws IOException {
return (getEncoding() != null ?
getConfiguration().getTemplate(name, locale, getEncoding()) :
getConfiguration().getTemplate(name, locale));
final Template template;
synchronized (this) {
template = getEncoding() != null ?
getConfiguration().getTemplate(name, locale, getEncoding()) :
getConfiguration().getTemplate(name, locale);
}
return template;
}

/**
Expand Down

0 comments on commit 16b4cbb

Please sign in to comment.