velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1874972 - /velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java
Date Sun, 08 Mar 2020 10:51:38 GMT
Author: cbrisson
Date: Sun Mar  8 10:51:38 2020
New Revision: 1874972

URL: http://svn.apache.org/viewvc?rev=1874972&view=rev
Log:
[tools/generic] Tool config: deprecate setClass(Class), have setClass(String) call setClassname(String)

Modified:
    velocity/tools/trunk/velocity-tools-generic/src/main/java/org/apache/velocity/tools/config/ToolConfiguration.java

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=1874972&r1=1874971&r2=1874972&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
Sun Mar  8 10:51:38 2020
@@ -65,11 +65,23 @@ public class ToolConfiguration extends C
         }
     }
 
+    /**
+     * This method should be avoided, since considered unsafe
+     * by the security manager.
+     * @param clazz the Class
+     * @see #setClassname(String classname)
+     */
+    @Deprecated
     public void setClass(Class clazz)
     {
         setClassname(clazz.getName());
     }
 
+    public void setClass(String classname)            
+    {
+        setClassname(classname);
+    }    
+    
     public void setClassname(String classname)
     {
         this.classname = classname;



Mime
View raw message