Author: cbrisson Date: Fri Oct 14 10:54:20 2016 New Revision: 1764871 URL: http://svn.apache.org/viewvc?rev=1764871&view=rev Log: [tools] Various deprecation cleaning and libraries upgrading - set java language source and target version to 1.7 - upgraded slf4j to version 1.7.21 - removed maven reporting and changelog plugins - upgraded javadoc plugin from 2.7 to 2.10.4 - removed deprecated 1.x xml format handling (toolbox.xml file) - removed deprecated 1.x tools initialization handling (via init() method) - removed several deprecated methods and fields in tools - removed deprecated package o.a.v.tools.view.servlet - removed deprecated package o.a.v.tools.view.context - removed deprecated generic tools: IteratorTool and ListTool - removed deprecated gereric tools utility class AbstractLockConfig - upgraded commons-beanutils from 1.8.3 to 1.9.3 - upgraded commons-digester from 1.8.1 to 3.2 - upgarded junit from 4.8.1 to 4.12 - upgraded easymock from 3.0 to 3.4 - upgraded dom4j from 1.1 to 1.6.1 (and consequently added a new dependency on jaxen 1.1.6) - bugfix in o.a.v.tools.config.Data for list types handling (revealed by common-beans upgrade)
Removed: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/OldToolInfo.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/OldXmlFactoryConfigurationRuleSet.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/AbstractLockConfig.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/IteratorTool.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ListTool.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/DataInfo.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ToolInfo.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ToolboxManager.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ToolboxRuleSet.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolInfo.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/XMLToolboxManager.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/context/ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/i18n/MultiViewsTool.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/servlet/ Modified: velocity/tools/trunk/pom.xml velocity/tools/trunk/src/changes/changes.xml velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml velocity/tools/trunk/velocity-tools-generic/pom.xml velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfigurationRuleSet.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/AlternatorTool.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/NumberTool.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/SafeConfig.java velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ValueParser.java velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/FormTool.java velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/TilesTool.java velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java velocity/tools/trunk/velocity-tools-view/pom.xml velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java velocity/tools/trunk/velocity-tools-xml/pom.xml Modified: velocity/tools/trunk/pom.xml URL: http://svn.apache.org/viewvc/velocity/tools/trunk/pom.xml?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/pom.xml (original) +++ velocity/tools/trunk/pom.xml Fri Oct 14 10:54:20 2016 @@ -44,7 +44,7 @@ <inceptionYear>2002</inceptionYear> <properties> - <slf4j.version>1.7.12</slf4j.version> + <slf4j.version>1.7.21</slf4j.version> </properties> <build> @@ -67,16 +67,12 @@ <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> - <source>1.5</source> - <target>1.5</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <configuration> - <inputEncoding>UTF-8</inputEncoding> - <outputEncoding>UTF-8</outputEncoding> + <debug>false</debug> + <optimize>true</optimize> + <showDeprecation>true</showDeprecation> + <showWarning>true</showWarning> + <source>1.7</source> + <target>1.7</target> </configuration> </plugin> <plugin> @@ -91,95 +87,19 @@ </includes> </configuration> </plugin> - </plugins> - </build> - - <distributionManagement> - <site> - <id>velocity.apache.org</id> - <url>scpexe://people.apache.org/www/velocity.apache.org/tools/devel/</url> - </site> - </distributionManagement> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-project-info-reports-plugin</artifactId> - <version>2.1</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-changes-plugin</artifactId> - <reportSets> - <reportSet> - <reports> - <report>changes-report</report> - <!-- <report>jira-report</report> --> - </reports> - </reportSet> - </reportSets> - <configuration> - <!-- no FixFor yet. --> - <filter>sorter/field=issuekey&sorter/order=ASC</filter> - <maxEntries>100</maxEntries> - <teamlist>http://velocity.apache.org/who-we-are.html</teamlist> - </configuration> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>taglist-maven-plugin</artifactId> - <configuration> - <tag>TODO</tag> - <tag>FIXME</tag> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jxr-plugin</artifactId> - </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <version>2.7</version> + <version>2.10.4</version> <configuration> + <aggregate>true</aggregate> <excludePackageNames>org.apache.velocity.tools.examples</excludePackageNames> <links> - <link>http://java.sun.com/j2se/1.5.0/docs/api/ - </link> - <link>http://jakarta.apache.org/oro/api</link> - <link>http://commons.apache.org/lang/api-release/ - </link> - <link>http://commons.apache.org/collections/api-release/ - </link> - <link>http://logging.apache.org/log4j/1.2/apidocs/ - </link> - <link>http://excalibur.apache.org/apidocs</link> - <link>http://tomcat.apache.org/tomcat-4.1-doc/servletapi/ - </link> </links> </configuration> - <reportSets> - <reportSet> - <id>non-aggregate</id> - <reports> - <report>javadoc</report> - </reports> - </reportSet> - <reportSet> - <id>aggregated</id> - <reports> - <report>aggregate</report> - </reports> - </reportSet> - </reportSets> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-changelog-plugin</artifactId> </plugin> </plugins> - </reporting> + </build> <issueManagement> <system>JIRA</system> Modified: velocity/tools/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/changes/changes.xml?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/src/changes/changes.xml (original) +++ velocity/tools/trunk/src/changes/changes.xml Fri Oct 14 10:54:20 2016 @@ -26,6 +26,9 @@ <body> <release version="3.0-SNAPSHOT" date="In Subversion"> + <action type="fix" dev="cbrisson"> + Removed deprecated 1.x configuration handling and depreacted 1.x tools initialization support + </action> <action type="add" dev="cbrisson"> Switched engine dependency to 2.0 </action> Modified: velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml (original) +++ velocity/tools/trunk/velocity-tools-examples/velocity-tools-examples-showcase/src/main/webapp/WEB-INF/web.xml Fri Oct 14 10:54:20 2016 @@ -27,10 +27,6 @@ <servlet-name>velocity</servlet-name> <servlet-class>org.apache.velocity.tools.view.VelocityLayoutServlet</servlet-class> <init-param> - <param-name>org.apache.velocity.tools.deprecationSupportMode</param-name> - <param-value>false</param-value> - </init-param> - <init-param> <param-name>org.apache.velocity.tools.cleanConfiguration</param-name> <param-value>true</param-value> </init-param> Modified: velocity/tools/trunk/velocity-tools-generic/pom.xml URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/pom.xml?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/pom.xml (original) +++ velocity/tools/trunk/velocity-tools-generic/pom.xml Fri Oct 14 10:54:20 2016 @@ -31,36 +31,36 @@ <name>Apache Velocity Tools - Generic tools</name> <description>Generic tools that can be used in any context.</description> <dependencies> - <dependency> - <groupId>org.apache.velocity</groupId> - <artifactId>velocity-engine-core</artifactId> - <version>2.0.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> - <version>1.8.3</version> - </dependency> - <dependency> - <groupId>commons-digester</groupId> - <artifactId>commons-digester</artifactId> - <version>1.8.1</version> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>${slf4j.version}</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.8.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-simple</artifactId> - <version>${slf4j.version}</version> - </dependency> + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity-engine-core</artifactId> + <version>2.0.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>commons-beanutils</groupId> + <artifactId>commons-beanutils</artifactId> + <version>1.9.3</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-digester3</artifactId> + <version>3.2</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <version>${slf4j.version}</version> + </dependency> </dependencies> </project> Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ConfigurationUtils.java Fri Oct 14 10:54:20 2016 @@ -328,7 +328,7 @@ public class ConfigurationUtils { try { - return read(file.toURL()); + return read(file.toURI().toURL()); } catch (MalformedURLException mue) { Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/Data.java Fri Oct 14 10:54:20 2016 @@ -113,12 +113,6 @@ public class Data implements Comparable< this.target = type.getTarget(); this.converter = type.getConverter(); } - else if (type.isList()) - { - // go ahead and set the target and type value for custom lists - this.typeValue = type.value(); - this.target = type.getTarget(); - } } public void setType(String t) @@ -284,8 +278,6 @@ public class Data implements Comparable< return out.toString(); } - - protected Object convert(Object value) { if (this.isList) @@ -317,7 +309,6 @@ public class Data implements Comparable< } else { - //TODO: make sure this works as expected... List<String> list = Arrays.asList(value.split(",")); if (this.converter == null || this.target.equals(String.class)) { @@ -352,32 +343,39 @@ public class Data implements Comparable< FIELD(Object.class, new FieldConverter()), NUMBER(Number.class, new NumberConverter()), STRING(String.class, new StringConverter()), - LIST(List.class, null), - LIST_AUTO(List.class, AUTO.getConverter()), - LIST_BOOLEAN(List.class, BOOLEAN.getConverter()), - LIST_FIELD(List.class, FIELD.getConverter()), - LIST_NUMBER(List.class, NUMBER.getConverter()), - LIST_STRING(List.class, STRING.getConverter()); + LIST(Object.class, null, true), + LIST_AUTO(Object.class, AUTO.getConverter(), true), + LIST_BOOLEAN(Boolean.class, BOOLEAN.getConverter(), true), + LIST_FIELD(Object.class, FIELD.getConverter(), true), + LIST_NUMBER(Number.class, NUMBER.getConverter(), true), + LIST_STRING(String.class, STRING.getConverter(), true); + private boolean isList; private Class target; private Converter converter; Type(Class t, Converter c) { + this(t, c, false); + } + + Type(Class t, Converter c, boolean lst) + { this.target = t; this.converter = c; + this.isList = lst; } public boolean isCustom() { // custom ones require the user to provide the converter - return (this.converter == null); + return (this.target == null); } public boolean isList() { // all list types return lists - return (this.target == List.class); + return isList; } public Class getTarget() Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java Fri Oct 14 10:54:20 2016 @@ -20,16 +20,14 @@ package org.apache.velocity.tools.config */ import java.lang.reflect.Method; -import org.apache.velocity.tools.OldToolInfo; import org.apache.velocity.tools.ToolInfo; import org.apache.velocity.tools.ClassUtils; /** * <p>This class handles configuration info for tools, including their key, * classname, path restriction, and properties. It also does fairly - * aggresive validation and is able to identify if the tool is "old" - * (i.e. designed for VelocityTools 1.x). Once configuration is - * complete, a {@link ToolInfo} instance can be created by calling + * aggresive validation. + * Once configuration is complete, a {@link ToolInfo} instance can be created by calling * {@link #createInfo}.</p> * <p> * Most users will not find themselves directly using the API of this class. @@ -41,7 +39,7 @@ import org.apache.velocity.tools.ClassUt public class ToolConfiguration extends Configuration { private enum Status { - VALID, OLD, NONE, MISSING, UNSUPPORTED, UNINSTANTIABLE; + VALID, NONE, MISSING, UNSUPPORTED, UNINSTANTIABLE; } private String key; @@ -189,7 +187,6 @@ public class ToolConfiguration extends C this.status = Status.NONE; } - // check for mere presence of init() or configure() try { // make sure the classname resolves to a class we have @@ -201,27 +198,6 @@ public class ToolConfiguration extends C // create an instance to make sure we can do that clazz.newInstance(); - // check for an init method - Method init = - clazz.getMethod("init", new Class[]{ Object.class }); - - // if init is deprecated, then we'll consider it a - // new tool with BC support, not an old tool - Deprecated bc = init.getAnnotation(Deprecated.class); - if (bc == null) - { - this.status = Status.OLD; - this.problem = null; - } - else - { - this.status = Status.VALID; - this.problem = null; - } - } - catch (NoSuchMethodException nsme) - { - // ignore this this.status = Status.VALID; this.problem = null; } @@ -276,9 +252,6 @@ public class ToolConfiguration extends C case VALID: info = new ToolInfo(getKey(), getToolClass()); break; - case OLD: - info = new OldToolInfo(getKey(), getToolClass()); - break; default: throw problem == null ? new ConfigurationException(this, getError(status)) : @@ -352,7 +325,6 @@ public class ToolConfiguration extends C switch (status) { case VALID: - case OLD: break; default: throw new ConfigurationException(this, getError(status)); @@ -421,9 +393,6 @@ public class ToolConfiguration extends C { case VALID: break; - case OLD: - out.append("Old "); - break; case NONE: case MISSING: out.append("Invalid "); Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfiguration.java Fri Oct 14 10:54:20 2016 @@ -22,8 +22,8 @@ package org.apache.velocity.tools.config import java.io.InputStream; import java.io.IOException; import org.xml.sax.SAXException; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.RuleSet; +import org.apache.commons.digester3.Digester; +import org.apache.commons.digester3.RuleSet; /** * <p>This reads in configuration info formatted as an XML file @@ -46,16 +46,10 @@ import org.apache.commons.digester.RuleS public class XmlFactoryConfiguration extends FileFactoryConfiguration { private RuleSet ruleSet; - private boolean supportOldXml; public XmlFactoryConfiguration() { - this(false, ""); - } - - public XmlFactoryConfiguration(boolean supportOldConfig) - { - this(supportOldConfig, String.valueOf(supportOldConfig)); + this(""); } /** @@ -67,24 +61,8 @@ public class XmlFactoryConfiguration ext */ public XmlFactoryConfiguration(String id) { - this(false, id); - } - - /** - * Creates an instance using the specified string - * as an identifier to distinguish this instance when debugging - * and using the specified setting for supporting the old toolbox.xml - * format from VelocityTools 1.x. - * - * @param supportOldConfig whether the old toolbox.xml format should be supported - * @param id the name of the "source" of this instance - * @see FactoryConfiguration#setSource(String) - */ - public XmlFactoryConfiguration(boolean supportOldConfig, String id) - { super(XmlFactoryConfiguration.class, id); setRuleSet(new XmlFactoryConfigurationRuleSet()); - this.supportOldXml = supportOldConfig; } /** @@ -119,10 +97,6 @@ public class XmlFactoryConfiguration ext digester.setUseContextClassLoader(true); digester.push(this); digester.addRuleSet(getRuleSet()); - if (supportOldXml) - { - digester.addRuleSet(new OldXmlFactoryConfigurationRuleSet()); - } try { digester.parse(input); Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfigurationRuleSet.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfigurationRuleSet.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfigurationRuleSet.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/XmlFactoryConfigurationRuleSet.java Fri Oct 14 10:54:20 2016 @@ -19,9 +19,9 @@ package org.apache.velocity.tools.config * under the License. */ -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.Rule; -import org.apache.commons.digester.RuleSetBase; +import org.apache.commons.digester3.Digester; +import org.apache.commons.digester3.Rule; +import org.apache.commons.digester3.RuleSetBase; import org.xml.sax.Attributes; /** @@ -137,7 +137,7 @@ public class XmlFactoryConfigurationRule public void body(String namespace, String element, String value) throws Exception { - Data data = (Data)digester.peek(); + Data data = (Data)getDigester().peek(); if (data.getValue() == null) { data.setValue(value); @@ -150,7 +150,7 @@ public class XmlFactoryConfigurationRule public void begin(String namespace, String element, Attributes attributes) throws Exception { - Configuration config = (Configuration)digester.peek(); + Configuration config = (Configuration)getDigester().peek(); for (int i=0; i < attributes.getLength(); i++) { Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/AlternatorTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/AlternatorTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/AlternatorTool.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/AlternatorTool.java Fri Oct 14 10:54:20 2016 @@ -58,9 +58,6 @@ import org.apache.velocity.tools.config. @DefaultKey("alternator") public class AlternatorTool extends SafeConfig { - @Deprecated - public static final String OLD_AUTO_ALTERNATE_DEFAULT_KEY = "auto-alternate"; - public static final String AUTO_ALTERNATE_DEFAULT_KEY = "autoAlternate"; // it's true by default in Alternator @@ -72,13 +69,7 @@ public class AlternatorTool extends Safe */ protected void configure(ValueParser parser) { - Boolean auto = parser.getBoolean(AUTO_ALTERNATE_DEFAULT_KEY); - if (auto == null) - { - // check for old key, use true as default (just like Alternator) - auto = parser.getBoolean(OLD_AUTO_ALTERNATE_DEFAULT_KEY, - Boolean.TRUE); - } + Boolean auto = parser.getBoolean(AUTO_ALTERNATE_DEFAULT_KEY, Boolean.TRUE); this.autoAlternateDefault = auto.booleanValue(); } @@ -109,15 +100,6 @@ public class AlternatorTool extends Safe } /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public Alternator make(Collection list) - { - return make(autoAlternateDefault, list); - } - - /** * Returns a new Alternator for the specified list with the specified * automatic shifting preference. * @@ -140,37 +122,6 @@ public class AlternatorTool extends Safe } /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public Alternator make(boolean auto, Collection list) - { - return make(auto, new Object[] { list }); - } - - /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public Alternator make(Object o1, Object o2) - { - return make(autoAlternateDefault, o1, o2); - } - - /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public Alternator make(boolean auto, Object o1, Object o2) - { - if (o1 == null || o2 == null) - { - return null; - } - return new Alternator(auto, new Object[] { o1, o2 }); - } - - /** * Make an automatic {@link Alternator} from the specified objects. * * @return a new, automatic Alternator with the specified values or @@ -183,24 +134,6 @@ public class AlternatorTool extends Safe } /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public Alternator auto(Collection list) - { - return make(true, list); - } - - /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public Alternator auto(Object o1, Object o2) - { - return make(true, o1, o2); - } - - /** * Make a manual {@link Alternator} from the specified objects. * * @return a new, manual Alternator with the values in the array or @@ -211,23 +144,4 @@ public class AlternatorTool extends Safe { return make(false, list); } - - /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public Alternator manual(Collection list) - { - return make(false, list); - } - - /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public Alternator manual(Object o1, Object o2) - { - return make(false, o1, o2); - } - } Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DateTool.java Fri Oct 14 10:54:20 2016 @@ -70,12 +70,6 @@ import org.apache.velocity.tools.config. @DefaultKey("date") public class DateTool extends FormatConfig { - @Deprecated - public static final String DEFAULT_FORMAT_KEY = FORMAT_KEY; - - @Deprecated - public static final String DEFAULT_LOCALE_KEY = ToolContext.LOCALE_KEY; - /** * The key used for specifying a default timezone via tool configuration. */ @@ -580,46 +574,6 @@ public class DateTool extends FormatConf return ConversionUtils.getDateFormat(dateStyle, timeStyle, locale, timezone); } - /** - * Returns a {@link DateFormat} instance for the specified - * time style, date style, {@link Locale}, and {@link TimeZone}. - * - * @param dateStyle the date style (date will be ignored if this is - * less than zero and the date style is not) - * @param timeStyle the time style (time will be ignored if this is - * less than zero and the date style is not) - * @param locale the {@link Locale} to be used - * @param timezone the {@link TimeZone} to be used - * @return an instance of {@link DateFormat} or <code>null</code> - * if an instance cannot be constructed with the given - * parameters - * @since VelocityTools 1.1 - */ - @Deprecated - protected DateFormat getDateFormat(int dateStyle, int timeStyle, - Locale locale, TimeZone timezone) - { - return ConversionUtils.getDateFormat(dateStyle, timeStyle, locale, timezone); - } - - /** - * Checks a string to see if it matches one of the standard DateFormat - * style patterns: FULL, LONG, MEDIUM, SHORT, or DEFAULT. If it does, - * it will return the integer constant for that pattern. If not, it - * will return -1. - * - * @see DateFormat - * @param style the string to be checked - * @return the int identifying the style pattern - * @since VelocityTools 1.1 - */ - @Deprecated - protected int getStyleAsInt(String style) - { - return ConversionUtils.getDateStyleAsInt(style); - } - - // ------------------------- date conversion methods --------------- /** Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/DisplayTool.java Fri Oct 14 10:54:20 2016 @@ -357,33 +357,6 @@ public class DisplayTool extends LocaleC } /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public String message(String format, Collection args) - { - return message(format, new Object[] { args }); - } - - /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public String message(String format, Object arg) - { - return message(format, new Object[] { arg }); - } - - /** - * @deprecated Will be unnecessary with Velocity 1.6 - */ - @Deprecated - public String message(String format, Object arg1, Object arg2) - { - return message(format, new Object[] { arg1, arg2 }); - } - - /** * Uses {@link MessageFormat} to format the specified String with * the specified arguments. If there are no arguments, then the String * is returned directly. Please note that the format Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/MathTool.java Fri Oct 14 10:54:20 2016 @@ -714,31 +714,6 @@ public class MathTool extends FormatConf return value.indexOf('.') >= 0; } - @Deprecated - protected Number parseNumber(String value) - { - // check for the floating point - if (!hasFloatingPoint(value)) - { - // check for large numbers - long i = Long.valueOf(value).longValue(); - if (i > Integer.MAX_VALUE || i < Integer.MIN_VALUE) - { - return Long.valueOf(i); - } - else - { - return Integer.valueOf((int)i); - } - } - else - { - return new Double(value); - } - } - - - // ------------------------- Aggregation methods ------------------ /** Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/NumberTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/NumberTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/NumberTool.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/NumberTool.java Fri Oct 14 10:54:20 2016 @@ -60,13 +60,6 @@ import org.apache.velocity.tools.config. @DefaultKey("number") public class NumberTool extends FormatConfig { - @Deprecated - public static final String DEFAULT_FORMAT_KEY = FORMAT_KEY; - - @Deprecated - public static final String DEFAULT_LOCALE_KEY = ToolContext.LOCALE_KEY; - - // ------------------------- formatting methods --------------------------- /** @@ -176,41 +169,6 @@ public class NumberTool extends FormatCo return ConversionUtils.getNumberFormat(format, locale); } - /** - * Returns a {@link NumberFormat} instance for the specified - * number style and {@link Locale}. - * - * @param numberStyle the number style (number will be ignored if this is - * less than zero or the number style is not recognized) - * @param locale the {@link Locale} to be used - * @return an instance of {@link NumberFormat} or <code>null</code> - * if an instance cannot be constructed with the given - * parameters - */ - @Deprecated - protected NumberFormat getNumberFormat(int numberStyle, Locale locale) - { - return ConversionUtils.getNumberFormat(numberStyle, locale); - } - - /** - * Checks a string to see if it matches one of the standard - * NumberFormat style patterns: - * NUMBER, CURRENCY, PERCENT, INTEGER, or DEFAULT. - * if it does it will return the integer constant for that pattern. - * if not, it will return -1. - * - * @see NumberFormat - * @param style the string to be checked - * @return the int identifying the style pattern - */ - @Deprecated - protected int getStyleAsInt(String style) - { - return ConversionUtils.getNumberStyleAsInt(style); - } - - // ------------------------- number conversion methods --------------- /** Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java Fri Oct 14 10:54:20 2016 @@ -79,8 +79,6 @@ public class ResourceTool extends Locale public static final String BUNDLES_KEY = "bundles"; private String[] bundles = new String[] { "resources" }; - private boolean deprecationSupportMode = false; - protected final void setDefaultBundle(String bundle) { @@ -96,29 +94,6 @@ public class ResourceTool extends Locale return this.bundles[0]; } - @Deprecated - protected final void setDefaultLocale(Locale locale) - { - if (locale == null) - { - throw new NullPointerException("Default locale cannot be null"); - } - super.setLocale(locale); - } - - @Deprecated - protected final Locale getDefaultLocale() - { - return super.getLocale(); - } - - @Deprecated - public void setDeprecationSupportMode(boolean depMode) - { - this.deprecationSupportMode = depMode; - } - - protected void configure(ValueParser parser) { String[] bundles = parser.getStrings(BUNDLES_KEY); @@ -343,17 +318,10 @@ public class ResourceTool extends Locale * Renders the specified resource value and arguments as a String. * The resource is treated as a {@link MessageFormat} pattern which * is used for formatting along with any specified argument values. - * If <code>deprecationSupportMode</code> is set to true, then this - * will return the resource directly when there are no args (as it - * did in 1.x versions). */ public String render(Object resource, Object[] args) { String value = String.valueOf(resource); - if (deprecationSupportMode && args == null) - { - return value; - } return MessageFormat.format(value, args); } Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/SafeConfig.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/SafeConfig.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/SafeConfig.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/SafeConfig.java Fri Oct 14 10:54:20 2016 @@ -51,8 +51,6 @@ public class SafeConfig * from reconfiguring this tool. The default is true. */ public static final String LOCK_CONFIG_KEY = "lockConfig"; - @Deprecated - public static final String OLD_LOCK_CONFIG_KEY = "lock-config"; /** * Many tools interested in locking configure() also have other @@ -115,14 +113,7 @@ public class SafeConfig setSafeMode(values.getBoolean(SAFE_MODE_KEY, true)); // check under the new key - Boolean lock = values.getBoolean(LOCK_CONFIG_KEY); - if (lock == null) - { - // now check the old key (for now) - // by default, lock down this method after use - // to prevent templates from re-configuring this instance - lock = values.getBoolean(OLD_LOCK_CONFIG_KEY, Boolean.TRUE); - } + Boolean lock = values.getBoolean(LOCK_CONFIG_KEY, Boolean.TRUE); setLockConfig(lock.booleanValue()); } } Modified: velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ValueParser.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ValueParser.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ValueParser.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/generic/ValueParser.java Fri Oct 14 10:54:20 2016 @@ -48,7 +48,7 @@ public class ValueParser extends Convers { private Map<String,Object> source = null; - private boolean allowSubkeys = true; /* default to whatever, should be overridden by deprecationSupportMode default value anyway */ + private boolean allowSubkeys = true; /* when using subkeys, cache at least the presence of any subkey, so that the rendering of templates not using subkeys will only @@ -145,15 +145,6 @@ public class ValueParser extends Convers { super.configure(values); - // if we're supporting 1.x behavior - Boolean depMode = values.getBoolean("deprecationSupportMode"); - if (depMode != null && depMode.booleanValue()) - { - // then don't allow subkeys - setAllowSubkeys(false); - } - - // except if explicitely asked for Boolean allow = values.getBoolean(ALLOWSUBKEYS_KEY); if(allow != null) { Modified: velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java (original) +++ velocity/tools/trunk/velocity-tools-generic/src/test/java/org/apache/velocity/tools/test/whitebox/ConfigTests.java Fri Oct 14 10:54:20 2016 @@ -45,7 +45,6 @@ import org.apache.velocity.tools.generic public class ConfigTests { private static final String XML_PATH = "tools.test.xml"; - private static final String OLD_XML_PATH = "toolbox.test.xml"; private static final String PROPS_PATH = "tools.test.properties"; protected FactoryConfiguration getBaseConfig() @@ -97,23 +96,6 @@ public class ConfigTests { assertConfigEquals(getBaseConfig(), xml); } - public @Test void testOldConfig() - { - FileFactoryConfiguration old = new XmlFactoryConfiguration(true); - old.read(OLD_XML_PATH); - - FactoryConfiguration base = getBaseConfig(); - // remove the request toolbox property locale=en_US manually, - // because the old format provide no means to set properties - // on a whole toolbox - base.getToolbox("request").removeProperty("locale"); - // add the expected deprecationSupportMode property - base.setProperty("deprecationSupportMode", "true"); - - assertValid(old); - assertConfigEquals(base, old); - } - public @Test void testPropsConfig() { FileFactoryConfiguration props = new PropertiesFactoryConfiguration(); @@ -358,16 +340,6 @@ public class ConfigTests { ToolConfiguration tool = new ToolConfiguration(); // set a real class, confirm it is valid - tool.setClass(OldTool.class); - assertValid(tool); - // and confirm the default key - assertEquals("old", tool.getKey()); - - // the toString() should describe this as old, due - // to the non-deprecated init() method - assertTrue((tool.toString().indexOf("Old") >= 0)); - - // change to a more modern class, confirm it's valid tool.setClassname(FakeTool.class.getName()); assertValid(tool); // and confirm the default key annotation works @@ -398,18 +370,6 @@ public class ConfigTests { /************* Support classes and methods ******************/ - - public static class OldTool - { - public void init(Object foo) - { - // does nothing - } - - // exists only to keep the testrunner happy - public @Test @Ignore void foo() {} - } - @DefaultKey("test") public static class FakeTool { Modified: velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/FormTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/FormTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/FormTool.java (original) +++ velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/FormTool.java Fri Oct 14 10:54:20 2016 @@ -80,15 +80,6 @@ public class FormTool // --------------------------------------------- Constructors ------------- - @Deprecated - public void init(Object obj) - { - if (obj instanceof ViewContext) - { - setRequest(((ViewContext)obj).getRequest()); - } - } - /** * Initializes this tool. * Modified: velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java (original) +++ velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/MessageResourcesTool.java Fri Oct 14 10:54:20 2016 @@ -44,18 +44,6 @@ public abstract class MessageResourcesTo private Locale locale; private MessageResources resources; - @Deprecated - public void init(Object obj) - { - if (obj instanceof ViewContext) - { - ViewContext ctx = (ViewContext)obj; - this.request = ctx.getRequest(); - this.application = ctx.getServletContext(); - this.LOG = ctx.getVelocityEngine().getLog(); - } - } - /** * Initializes this tool. * Modified: velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/TilesTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/TilesTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/TilesTool.java (original) +++ velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/TilesTool.java Fri Oct 14 10:54:20 2016 @@ -91,20 +91,6 @@ public class TilesTool extends ImportSup /******************************* Constructors ****************************/ - @Deprecated - public void init(Object obj) - { - if (obj instanceof ViewContext) - { - ViewContext ctx = (ViewContext)obj; - setVelocityContext(ctx.getVelocityContext()); - setRequest(ctx.getRequest()); - setResponse(ctx.getResponse()); - setServletContext(ctx.getServletContext()); - setLog(ctx.getVelocityEngine().getLog()); - } - } - /** * Initializes this tool. * Modified: velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java (original) +++ velocity/tools/trunk/velocity-tools-struts/src/main/java/org/apache/velocity/tools/struts/ValidatorTool.java Fri Oct 14 10:54:20 2016 @@ -154,19 +154,6 @@ public class ValidatorTool } }; - - @Deprecated - public void init(Object obj) - { - if (obj instanceof ViewContext) - { - this.context = (ViewContext)obj; - this.request = context.getRequest(); - this.session = request.getSession(false); - this.app = context.getServletContext(); - } - } - /** * Initializes this tool. * Modified: velocity/tools/trunk/velocity-tools-view/pom.xml URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/pom.xml?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/pom.xml (original) +++ velocity/tools/trunk/velocity-tools-view/pom.xml Fri Oct 14 10:54:20 2016 @@ -20,56 +20,56 @@ --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <artifactId>velocity-tools-parent</artifactId> - <groupId>org.apache.velocity</groupId> - <version>3.0-SNAPSHOT</version> - </parent> - <groupId>org.apache.velocity</groupId> - <artifactId>velocity-tools-view</artifactId> - <name>Apache Velocity Tools - View tools</name> - <description>Tools to be used in a servlet context.</description> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <includes> - <include>**/Test*.java</include> - <include>**/*Test.java</include> - <include>**/*TestCase.java</include> - <include>**/*Tests.java</include> - </includes> - </configuration> - </plugin> - </plugins> - </build> - <dependencies> - <dependency> - <groupId>org.apache.velocity</groupId> - <artifactId>velocity-tools-generic</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.8.1</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.easymock</groupId> - <artifactId>easymock</artifactId> - <version>3.0</version> - <scope>test</scope> - </dependency> - </dependencies> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>velocity-tools-parent</artifactId> + <groupId>org.apache.velocity</groupId> + <version>3.0-SNAPSHOT</version> + </parent> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity-tools-view</artifactId> + <name>Apache Velocity Tools - View tools</name> + <description>Tools to be used in a servlet context.</description> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <includes> + <include>**/Test*.java</include> + <include>**/*Test.java</include> + <include>**/*TestCase.java</include> + <include>**/*Tests.java</include> + </includes> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity-tools-generic</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.5</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.easymock</groupId> + <artifactId>easymock</artifactId> + <version>3.4</version> + <scope>test</scope> + </dependency> + </dependencies> </project> Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/AbstractSearchTool.java Fri Oct 14 10:54:20 2016 @@ -107,7 +107,7 @@ import org.apache.velocity.tools.config. * <b>1</b> <a href="">2</a> <a href="">Next</a> * </p> * <p> - * <b>Example toolbox.xml configuration:</b> + * <b>Example tools.xml configuration:</b> * <pre> * <tools> * <toolbox scope="request"> Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ServletUtils.java Fri Oct 14 10:54:20 2016 @@ -344,15 +344,7 @@ public class ServletUtils return null; } - public static FactoryConfiguration getConfiguration(String path, - ServletContext application) - { - return getConfiguration(path, application, path.endsWith("toolbox.xml")); - } - - public static FactoryConfiguration getConfiguration(String path, - ServletContext application, - boolean deprecationSupportMode) + public static FactoryConfiguration getConfiguration(String path, ServletContext application) { // first make sure we can even get such a file InputStream inputStream = getInputStream(path, application); @@ -363,10 +355,10 @@ public class ServletUtils // then make sure it's a file type we recognize FileFactoryConfiguration config = null; - String source = "ServletUtils.getConfiguration("+path+",ServletContext[,depMode="+deprecationSupportMode+"])"; + String source = "ServletUtils.getConfiguration("+path+",ServletContext)"; if (path.endsWith(".xml")) { - config = new XmlFactoryConfiguration(deprecationSupportMode, source); + config = new XmlFactoryConfiguration(source); } else if (path.endsWith(".properties")) { Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/UiDependencyTool.java Fri Oct 14 10:54:20 2016 @@ -34,8 +34,8 @@ import org.slf4j.Logger; import org.xml.sax.Attributes; import org.xml.sax.SAXException; -import org.apache.commons.digester.Digester; -import org.apache.commons.digester.Rule; +import org.apache.commons.digester3.Digester; +import org.apache.commons.digester3.Rule; import org.apache.velocity.tools.ClassUtils; import org.apache.velocity.tools.view.ViewContext; import org.apache.velocity.tools.Scope; @@ -616,7 +616,7 @@ public class UiDependencyTool { private UiDependencyTool parent; public void begin(String ns, String el, Attributes attributes) throws Exception { - parent = (UiDependencyTool)digester.peek(); + parent = (UiDependencyTool)getDigester().peek(); for (int i=0; i < attributes.getLength(); i++) { String name = attributes.getLocalName(i); @@ -624,13 +624,13 @@ public class UiDependencyTool { name = attributes.getQName(i); } if ("name".equals(name)) { - digester.push(attributes.getValue(i)); + getDigester().push(attributes.getValue(i)); } } } public void body(String ns, String el, String typeFormat) throws Exception { - String typeName = (String)digester.pop(); + String typeName = (String)getDigester().pop(); parent.setFormat(typeName, typeFormat); } } @@ -644,7 +644,7 @@ public class UiDependencyTool { private UiDependencyTool parent; public void begin(String ns, String el, Attributes attributes) throws Exception { - parent = (UiDependencyTool)digester.peek(); + parent = (UiDependencyTool)getDigester().peek(); for (int i=0; i < attributes.getLength(); i++) { String name = attributes.getLocalName(i); @@ -652,13 +652,13 @@ public class UiDependencyTool { name = attributes.getQName(i); } if ("name".equals(name)) { - digester.push(parent.makeGroup(attributes.getValue(i))); + getDigester().push(parent.makeGroup(attributes.getValue(i))); } } } public void end(String ns, String el) throws Exception { - digester.pop(); + getDigester().pop(); } } @@ -675,14 +675,14 @@ public class UiDependencyTool { name = attributes.getQName(i); } if ("type".equals(name)) { - digester.push(attributes.getValue(i)); + getDigester().push(attributes.getValue(i)); } } } public void body(String ns, String el, String value) throws Exception { - String type = (String)digester.pop(); - Group group = (Group)digester.peek(); + String type = (String)getDigester().pop(); + Group group = (Group)getDigester().peek(); group.addFile(type, value); } } @@ -694,7 +694,7 @@ public class UiDependencyTool { protected static class NeedsRule extends Rule { public void body(String ns, String el, String otherGroup) throws Exception { - Group group = (Group)digester.peek(); + Group group = (Group)getDigester().peek(); group.addGroup(otherGroup); } } Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityLayoutServlet.java Fri Oct 14 10:54:20 2016 @@ -268,7 +268,7 @@ public class VelocityLayoutServlet exten // put the invocation exception in the context ctx.put(KEY_ERROR_INVOCATION_EXCEPTION, e); // get the real cause - cause = ((MethodInvocationException)e).getWrappedThrowable(); + cause = cause.getCause(); } // add the cause to the context Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityView.java Fri Oct 14 10:54:20 2016 @@ -39,7 +39,6 @@ import org.apache.velocity.context.Conte import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.io.VelocityWriter; import org.apache.velocity.runtime.RuntimeConstants; -import org.apache.velocity.shaded.commons.collections.ExtendedProperties; import org.apache.velocity.tools.ClassUtils; import org.apache.velocity.tools.Scope; import org.apache.velocity.tools.Toolbox; @@ -48,7 +47,7 @@ import org.apache.velocity.tools.config. import org.apache.velocity.tools.config.ConfigurationUtils; import org.apache.velocity.tools.config.FactoryConfiguration; import org.apache.velocity.tools.view.ViewToolContext; -import org.apache.velocity.tools.view.context.ChainedContext; +import org.apache.velocity.util.ExtProperties; import org.apache.velocity.util.SimplePool; /** @@ -117,9 +116,6 @@ public class VelocityView extends ViewTo * placed in the ServletContext attributes. */ public static final String TOOLS_KEY = ServletUtils.CONFIGURATION_KEY; - @Deprecated - public static final String DEPRECATED_TOOLS_KEY = - "org.apache.velocity.toolbox"; /** * Default toolbox configuration file path. If no alternate value for @@ -127,9 +123,6 @@ public class VelocityView extends ViewTo */ public static final String USER_TOOLS_PATH = "/WEB-INF/tools.xml"; - @Deprecated - public static final String DEPRECATED_USER_TOOLS_PATH = - "/WEB-INF/toolbox.xml"; /** * Default Runtime properties. @@ -153,14 +146,7 @@ public class VelocityView extends ViewTo /** * Controls loading of available default tool configurations - * provided by VelocityTools. The default behavior is conditional; - * if {@link #DEPRECATION_SUPPORT_MODE_KEY} has not been set to - * {@code false} and there is an old {@code toolbox.xml} configuration - * present, then the defaults will not be loaded unless you explicitly - * set this property to {@code true} in your init params. If there - * is no {@code toolbox.xml} and/or the deprecation support is turned off, - * then the default tools will be loaded automatically unless you - * explicitly set this property to {@code false} in your init params. + * provided by VelocityTools. The default is true. */ public static final String LOAD_DEFAULTS_KEY = "org.apache.velocity.tools.loadDefaults"; @@ -181,18 +167,8 @@ public class VelocityView extends ViewTo public static final String USER_OVERWRITE_KEY = "org.apache.velocity.tools.userCanOverwriteTools"; - /** - * Controls support for deprecated tools and configuration. - * The default is {@code true}; set to {@code false} to turn off - * support for deprecated tools and configuration. - */ - public static final String DEPRECATION_SUPPORT_MODE_KEY = - "org.apache.velocity.tools.deprecationSupportMode"; - - private static SimplePool writerPool = new SimplePool(40); private String defaultContentType = DEFAULT_CONTENT_TYPE; - private boolean deprecationSupportMode = true; public VelocityView(ServletConfig config) { @@ -217,16 +193,6 @@ public class VelocityView extends ViewTo init(config); } - @Deprecated - protected final void setDeprecationSupportMode(boolean support) - { - if (deprecationSupportMode != support) - { - this.deprecationSupportMode = support; - getLog().debug("deprecationSupportMode is now {}", (support ? "on" : "off")); - } - } - /** * Overrides super class to ensure engine is not set to null. */ @@ -298,12 +264,6 @@ public class VelocityView extends ViewTo this.velocity = new VelocityEngine(); } - // default is true for these, so just watch for false - String depMode = config.findInitParameter(DEPRECATION_SUPPORT_MODE_KEY); - if (depMode != null && depMode.equalsIgnoreCase("false")) - { - setDeprecationSupportMode(false); - } String allowOverwrite = config.findInitParameter(USER_OVERWRITE_KEY); if (allowOverwrite != null && allowOverwrite.equalsIgnoreCase("false")) { @@ -323,7 +283,7 @@ public class VelocityView extends ViewTo /** * Initializes the Velocity runtime, first calling * loadConfiguration(JeeConfig) to get a - * org.apache.velocity.shaded.commons.collections.ExtendedProperties + * org.apache.velocity.util.ExtProperties * of configuration information * and then calling velocityEngine.init(). Override this * to do anything to the environment before the @@ -358,17 +318,7 @@ public class VelocityView extends ViewTo protected void configure(final JeeConfig config, final VelocityEngine velocity) { // first get the default properties, and bail if we don't find them - ExtendedProperties defaultProperties = getProperties(DEFAULT_PROPERTIES_PATH, true); - // if using Velocity engine prior to 1.6.x, remove WebappUberspector - // (this hack will disappear once tools require Velocity 1.6.x+) - try { - Class.forName("org.apache.velocity.tools.view.WebappUberspector"); - } catch(Throwable t) { - // remove WebappUberspector from the list of introspectors - List introspectors = defaultProperties.getList(VelocityEngine.UBERSPECT_CLASSNAME); - introspectors.remove("org.apache.velocity.tools.view.WebappUberspector"); - defaultProperties.setProperty(VelocityEngine.UBERSPECT_CLASSNAME,introspectors); - } + ExtProperties defaultProperties = getProperties(DEFAULT_PROPERTIES_PATH, true); velocity.setExtendedProperties(defaultProperties); // check for application-wide user props in the context init params @@ -395,7 +345,7 @@ public class VelocityView extends ViewTo // this will throw an exception if require is true and there // are no properties at the path. if require is false, this // will return null when there's no properties at the path - ExtendedProperties props = getProperties(path, require); + ExtProperties props = getProperties(path, require); if (props == null) { return false; @@ -413,16 +363,10 @@ public class VelocityView extends ViewTo /** * Here's the configuration lookup/loading order: * <ol> - * <li>If deprecationSupportMode is true: - * <ol> - * <li>Config file optionally specified by {@code org.apache.velocity.toolbox} init-param (servlet or servletContext)</li> - * <li>If none, config file optionally at {@code /WEB-INF/toolbox.xml} (deprecated conventional location)</li> - * </ol> - * </li> - * <li>If no old toolbox or loadDefaults is true, {@link ConfigurationUtils#getDefaultTools()}</li> + * <li>If loadDefaults is true, {@link ConfigurationUtils#getDefaultTools()}</li> * <li>{@link ConfigurationUtils#getAutoLoaded}(false)</li> * <li>Config file optionally specified by servletContext {@code org.apache.velocity.tools} init-param</li> - * <li>Config file optionally at {@code /WEB-INF/tools.xml} (new conventional location)</li> + * <li>Config file optionally at {@code /WEB-INF/tools.xml} (conventional location)</li> * <li>Config file optionally specified by servlet {@code org.apache.velocity.tools} init-param</li> * </ol> * Remember that as these configurations are added on top of each other, @@ -436,22 +380,8 @@ public class VelocityView extends ViewTo { FactoryConfiguration factoryConfig = new FactoryConfiguration("VelocityView.configure(config,factory)"); - boolean hasOldToolbox = false; - if (this.deprecationSupportMode) - { - FactoryConfiguration oldToolbox = getDeprecatedConfig(config); - if (oldToolbox != null) - { - hasOldToolbox = true; - factoryConfig.addConfiguration(oldToolbox); - } - } - - // only load the default tools if they have explicitly said to - // or if they are not using an old toolbox and have said nothing String loadDefaults = config.findInitParameter(LOAD_DEFAULTS_KEY); - if ((!hasOldToolbox && loadDefaults == null) || - "true".equalsIgnoreCase(loadDefaults)) + if (loadDefaults == null || "true".equalsIgnoreCase(loadDefaults)) { // add all available default tools getLog().trace("Loading default tools configuration..."); @@ -460,10 +390,7 @@ public class VelocityView extends ViewTo else { // let the user know that the defaults were suppressed - getLog().debug("Default tools configuration has been suppressed{}", - (hasOldToolbox ? - " to avoid conflicts with older application's context and toolbox definition." : - ".")); + getLog().debug("Default tools configuration has been suppressed."); } // this gets the auto loaded config from the classpath @@ -508,45 +435,6 @@ public class VelocityView extends ViewTo configure(factoryConfig); } - /** - * First tries to find a path to a toolbox under the deprecated - * {@code org.apache.velocity.toolbox} key. - * If found, it tries to load the configuration there and will blow up - * if there is no config file there. - * If not found, it looks for a config file at /WEB-INF/toolbox.xml - * (the deprecated default location) and tries to load it if found. - */ - @Deprecated - protected FactoryConfiguration getDeprecatedConfig(JeeConfig config) - { - FactoryConfiguration toolbox = null; - - // look for specified path under the deprecated toolbox key - String oldPath = config.findInitParameter(DEPRECATED_TOOLS_KEY); - if (oldPath != null) - { - // ok, they said the toolbox.xml should be there - // so this should blow up if it is not - toolbox = getConfiguration(oldPath, true); - } - else - { - // check for deprecated user configuration at the old conventional - // location. be silent if missing, log deprecation warning otherwise - oldPath = DEPRECATED_USER_TOOLS_PATH; - toolbox = getConfiguration(oldPath); - } - - if (toolbox != null) - { - getLog().debug("Loaded deprecated configuration from: {}", oldPath); - getLog().warn("Please upgrade to new \"/WEB-INF/tools.xml\" format and conventional location."+ - " Support for \"/WEB-INF/toolbox.xml\" format and conventional file name will "+ - "be removed in a future version."); - } - return toolbox; - } - private boolean setConfig(FactoryConfiguration factory, String path, boolean require) { if (path == null) @@ -596,12 +484,12 @@ public class VelocityView extends ViewTo } - protected ExtendedProperties getProperties(String path) + protected ExtProperties getProperties(String path) { return getProperties(path, false); } - protected ExtendedProperties getProperties(String path, boolean required) + protected ExtProperties getProperties(String path, boolean required) { if (getLog().isTraceEnabled()) { @@ -614,7 +502,7 @@ public class VelocityView extends ViewTo return null; } - ExtendedProperties properties = new ExtendedProperties(); + ExtProperties properties = new ExtProperties(); try { properties.load(inputStream); @@ -661,9 +549,7 @@ public class VelocityView extends ViewTo FactoryConfiguration config = null; try { - config = ServletUtils.getConfiguration(path, - this.servletContext, - this.deprecationSupportMode); + config = ServletUtils.getConfiguration(path, this.servletContext); if (config == null) { String msg = "Did not find resource at: "+path; @@ -790,14 +676,7 @@ public class VelocityView extends ViewTo HttpServletResponse response) { ViewToolContext ctx; - if (this.deprecationSupportMode) - { - ctx = new ChainedContext(velocity, request, response, servletContext); - } - else - { - ctx = new ViewToolContext(velocity, request, response, servletContext); - } + ctx = new ViewToolContext(velocity, request, response, servletContext); prepareContext(ctx, request); return ctx; } @@ -816,29 +695,6 @@ public class VelocityView extends ViewTo } /** - * <p>Gets the requested template.</p> - * - * @param request client request - * @param response client response. - * @return Velocity Template object or null - * @deprecated Use {@link #getTemplate(HttpServletRequest)}. - */ - public Template getTemplate(HttpServletRequest request, - HttpServletResponse response) - { - String path = ServletUtils.getPath(request); - if (response == null) - { - return getTemplate(path); - } - else - { - return getTemplate(path, response.getCharacterEncoding()); - } - } - - - /** * Retrieves the requested template. * * @param name The file name of the template to retrieve relative to the Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewFilter.java Fri Oct 14 10:54:20 2016 @@ -57,9 +57,7 @@ import org.apache.velocity.tools.view.Vi * <dt>org.apache.velocity.tools.loadDefaults</dt> * <dd>By default, this is {@code true}. If set to {@code false}, then * the default toolbox configuration will not be added to your (if any) - * custom configuration. NOTE: The default configuration will also be - * suppressed if you are using a deprecated toolbox.xml format and do not - * explicitly set this to {@code true}.</dd> + * custom configuration.</dd> * <dt>org.apache.velocity.tools.cleanConfiguration</dt> * <dd>By default, this is {@code false}. If set to {@code true}, then * then the final toolbox configuration (the combination of any custom Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/VelocityViewServlet.java Fri Oct 14 10:54:20 2016 @@ -76,9 +76,7 @@ import org.apache.velocity.shaded.common * <dt>org.apache.velocity.tools.loadDefaults</dt> * <dd>By default, this is {@code true}. If set to {@code false}, then * the default toolbox configuration will not be added to your (if any) - * custom configuration. NOTE: The default configuration will also be - * suppressed if you are using a deprecated toolbox.xml format and do not - * explicitly set this to {@code true}.</dd> + * custom configuration.</dd> * <dt>org.apache.velocity.tools.cleanConfiguration</dt> * <dd>By default, this is {@code false}. If set to {@code true}, then * then the final toolbox configuration (the combination of any custom @@ -373,7 +371,7 @@ public class VelocityViewServlet extends if (cause instanceof MethodInvocationException) { // get the real cause - cause = ((MethodInvocationException)cause).getWrappedThrowable(); + cause = cause.getCause(); } StringWriter sw = new StringWriter(); Modified: velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/main/java/org/apache/velocity/tools/view/ViewToolManager.java Fri Oct 14 10:54:20 2016 @@ -233,7 +233,7 @@ public class ViewToolManager extends Too @Override protected FactoryConfiguration findConfig(String path) { - return ServletUtils.getConfiguration(path, servletContext, false); + return ServletUtils.getConfiguration(path, servletContext); } @Override Modified: velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java (original) +++ velocity/tools/trunk/velocity-tools-view/src/test/java/org/apache/velocity/tools/view/VelocityViewTest.java Fri Oct 14 10:54:20 2016 @@ -61,7 +61,6 @@ public class VelocityViewTest Context context = createMock(Context.class); expect(config.getServletContext()).andReturn(servletContext); - expect(config.findInitParameter(VelocityView.DEPRECATION_SUPPORT_MODE_KEY)).andReturn("false"); expect(config.findInitParameter(VelocityView.USER_OVERWRITE_KEY)).andReturn(null); expect(config.findInitParameter(VelocityView.LOAD_DEFAULTS_KEY)).andReturn("false"); expect(servletContext.getInitParameter(VelocityView.PROPERTIES_KEY)).andReturn(null); Modified: velocity/tools/trunk/velocity-tools-xml/pom.xml URL: http://svn.apache.org/viewvc/velocity/tools/trunk/velocity-tools-xml/pom.xml?rev=1764871&r1=1764870&r2=1764871&view=diff ============================================================================== --- velocity/tools/trunk/velocity-tools-xml/pom.xml (original) +++ velocity/tools/trunk/velocity-tools-xml/pom.xml Fri Oct 14 10:54:20 2016 @@ -31,21 +31,26 @@ <name>Apache Velocity Tools - XML tools</name> <description>Tools for XML manipulation in Velocity templates.</description> <dependencies> - <dependency> - <groupId>org.apache.velocity</groupId> - <artifactId>velocity-tools-generic</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>dom4j</groupId> - <artifactId>dom4j</artifactId> - <version>1.1</version> - </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.8.1</version> - <scope>test</scope> - </dependency> + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity-tools-generic</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.6.1</version> + </dependency> + <dependency> + <groupId>jaxen</groupId> + <artifactId>jaxen</artifactId> + <version>1.1.6</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> </dependencies> </project>