Author: arunpatidar
Date: Fri Aug 5 15:53:20 2016
New Revision: 1755358
URL:
http://svn.apache.org/viewvc?rev=1755358&view=revLog:
Applied patch from jira issue - OFBIZ-7811 - Enforce noninstantiability to FreeMarkerWorker class. Thanks Amit Gadaley and Rishi Solanki for your contribution.
Modified:
ofbiz/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java
Modified: ofbiz/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java?rev=1755358&r1=1755357&r2=1755358&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java (original)
+++ ofbiz/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/template/FreeMarkerWorker.java Fri Aug 5 15:53:20 2016
@@ -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);