diff --git a/plugins/generate-tostring/src/org/jetbrains/java/generate/velocity/VelocityFactory.java b/plugins/generate-tostring/src/org/jetbrains/java/generate/velocity/VelocityFactory.java index faaa80907a8e..7c163af065c1 100644 --- a/plugins/generate-tostring/src/org/jetbrains/java/generate/velocity/VelocityFactory.java +++ b/plugins/generate-tostring/src/org/jetbrains/java/generate/velocity/VelocityFactory.java @@ -17,12 +17,9 @@ package org.jetbrains.java.generate.velocity; import com.intellij.codeInsight.generation.VelocityIncludesClassLoader; import org.apache.commons.collections.ExtendedProperties; -import org.apache.velocity.app.Velocity; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.log.SimpleLog4JLogSystem; -import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader; -import org.apache.velocity.runtime.resource.loader.FileResourceLoader; /** * Velocity factory. @@ -31,7 +28,7 @@ import org.apache.velocity.runtime.resource.loader.FileResourceLoader; */ public class VelocityFactory { private static class Holder { - private static final VelocityEngine engine = newVeloictyEngine(); + private static final VelocityEngine engine = newVelocityEngine(); } /** @@ -47,12 +44,13 @@ public class VelocityFactory { * * @return a new velocity engine that is initialized. */ - private static VelocityEngine newVeloictyEngine() { + private static VelocityEngine newVelocityEngine() { ExtendedProperties prop = new ExtendedProperties(); prop.addProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, SimpleLog4JLogSystem.class.getName()); prop.addProperty("runtime.log.logsystem.log4j.category", "GenerateToString"); prop.addProperty(RuntimeConstants.RESOURCE_LOADER, "includes"); prop.addProperty("includes.resource.loader.class", VelocityIncludesClassLoader.class.getName()); + prop.addProperty(RuntimeConstants.VM_PERM_ALLOW_INLINE_REPLACE_GLOBAL, "true"); VelocityEngine velocity = new VelocityEngine(); velocity.setExtendedProperties(prop); velocity.init();