Applied patch from jira issue - OFBIZ-7811 - Enforce noninstantiability to FreeMarkerWorker class. Thanks Amit Gadaley and Rishi Solanki for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1755358 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Patidar
2016-08-05 15:53:20 +00:00
parent 3e170d76f5
commit fe33f59f6e
@@ -73,12 +73,14 @@ import freemarker.template.Version;
/** FreeMarkerWorker - Freemarker Template Engine Utilities.
*
*/
public class FreeMarkerWorker {
public final class FreeMarkerWorker {
public static final String module = FreeMarkerWorker.class.getName();
public static final Version version = Configuration.VERSION_2_3_24;
private FreeMarkerWorker () {}
// use soft references for this so that things from Content records don't kill all of our memory, or maybe not for performance reasons... hmmm, leave to config file...
private static final UtilCache<String, Template> cachedTemplates = UtilCache.createUtilCache("template.ftl.general", 0, 0, false);
private static final BeansWrapper defaultOfbizWrapper = new BeansWrapperBuilder(version).build();
@@ -138,9 +140,9 @@ public class FreeMarkerWorker {
}
/**
* Protected helper method.
* Public helper method.
*/
protected static void loadTransforms(ClassLoader loader, Properties props, Configuration config) {
public static void loadTransforms(ClassLoader loader, Properties props, Configuration config) {
for (Iterator<Object> i = props.keySet().iterator(); i.hasNext();) {
String key = (String) i.next();
String className = props.getProperty(key);