Author: wglass
Date: Wed Nov 1 23:32:37 2006
New Revision: 470261
URL: http://svn.apache.org/viewvc?view=rev&rev=470261
Log:
Apply javadoc fixes. VELOCITY-475.
Modified:
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/MethodMap.java
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java
Modified:
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java
URL:
http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java?view=diff&rev=470261&r1=470260&r2=470261
==============================================================================
---
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java
(original)
+++
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/ClassMap.java
Wed Nov 1 23:32:37 2006
@@ -189,6 +189,9 @@
* Make a methodKey for the given method using
* the concatenation of the name and the
* types of the method parameters.
+ *
+ * @param method to be stored as key
+ * @return key for ClassMap
*/
private String makeMethodKey(Method method)
{
@@ -256,6 +259,9 @@
* public, retrieves methods with same signature as its public methods
* from public superclasses and interfaces (if they exist). Basically
* upcasts every method to the nearest acccessible method.
+ *
+ * @param clazz class to check methods
+ * @return array of all public methods
*/
private static Method[] getAccessibleMethods(Class clazz)
{
@@ -436,6 +442,7 @@
* @param clazz the class whose method is sought
* @param name the name of the method
* @param paramTypes the classes of method parameters
+ * @return applicable method
*/
private static Method getPublicMethod(Class clazz, String name, Class[]
paramTypes)
{
Modified:
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/MethodMap.java
URL:
http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/MethodMap.java?view=diff&rev=470261&r1=470260&r2=470261
==============================================================================
---
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/MethodMap.java
(original)
+++
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/MethodMap.java
Wed Nov 1 23:32:37 2006
@@ -309,6 +309,10 @@
/**
* Returns true if the supplied method is applicable to actual
* argument types.
+ *
+ * @param method method that will be called
+ * @param classes arguments to method
+ * @return true if method is applicable to arguments
*/
private static boolean isApplicable(Method method, Class[] classes)
{
Modified:
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java
URL:
http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java?view=diff&rev=470261&r1=470260&r2=470261
==============================================================================
---
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java
(original)
+++
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java
Wed Nov 1 23:32:37 2006
@@ -31,7 +31,7 @@
/**
* Determine which methods and classes to prevent from executing.
*
- * @param o object for which method is being called
+ * @param clazz Class for which method is being called
* @param method method being called. This may be null in the case of a
call to iterator, get, or set method
*
* @return true if method may be called on object
Modified:
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java
URL:
http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java?view=diff&rev=470261&r1=470260&r2=470261
==============================================================================
---
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java
(original)
+++
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java
Wed Nov 1 23:32:37 2006
@@ -47,20 +47,30 @@
this.badPackages = badPackages;
}
-
- public Method getMethod(Class c, String name, Object[] params) throws
Exception
+ /**
+ * Get the Method object corresponding to the given class, name and
parameters.
+ * Will check for appropriate execute permissions and return null if the
method
+ * is not allowed to be executed.
+ *
+ * @param clazz Class on which method will be called
+ * @param methodName Name of method to be called
+ * @param params array of parameters to method
+ * @return Method object retrieved by Introspector
+ * @throws Exception
+ */
+ public Method getMethod(Class clazz, String methodName, Object[] params)
throws Exception
{
- if (!checkObjectExecutePermission(c,name))
+ if (!checkObjectExecutePermission(clazz,methodName))
{
- log.warn ("Cannot retrieve method " + name +
- " from object of class " + c.getName() +
+ log.warn ("Cannot retrieve method " + methodName +
+ " from object of class " + clazz.getName() +
" due to security restrictions.");
return null;
}
else
{
- return super.getMethod(c, name, params);
+ return super.getMethod(clazz, methodName, params);
}
}
@@ -71,11 +81,13 @@
* For the complete list, see the properties
<code>introspector.restrict.classes</code>
* and <code>introspector.restrict.packages</code>.
*
+ * @param clazz Class on which method will be called
+ * @param methodName Name of method to be called
* @see
org.apache.velocity.util.introspection.SecureIntrospectorControl#checkObjectExecutePermission(java.lang.Class,
java.lang.String)
*/
- public boolean checkObjectExecutePermission(Class clazz, String method)
+ public boolean checkObjectExecutePermission(Class clazz, String methodName)
{
- if (method == null)
+ if (methodName == null)
{
return false;
}
@@ -83,7 +95,7 @@
/**
* check for wait and notify
*/
- if ( method.equals("wait") || method.equals("notify") )
+ if ( methodName.equals("wait") || methodName.equals("notify") )
{
return false;
}
@@ -109,7 +121,7 @@
/**
* Always allow Class.getName()
*/
- else if (java.lang.Class.class.isAssignableFrom(clazz) &&
method.equals("getName"))
+ else if (java.lang.Class.class.isAssignableFrom(clazz) &&
methodName.equals("getName"))
{
return true;
}
Modified:
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java
URL:
http://svn.apache.org/viewvc/jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java?view=diff&rev=470261&r1=470260&r2=470261
==============================================================================
---
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java
(original)
+++
jakarta/velocity/engine/trunk/src/java/org/apache/velocity/util/introspection/SecureUberspector.java
Wed Nov 1 23:32:37 2006
@@ -65,8 +65,13 @@
}
/**
- * The superclass method does not call the introspector, so the
- * secure version needs to check for execute permission.
+ * Get an iterator from the given object. Since the superclass method
+ * this secure version checks for execute permission.
+ *
+ * @param obj object to iterate over
+ * @param i line, column, template info
+ * @return Iterator for object
+ * @throws Exception
*/
public Iterator getIterator(Object obj, Info i)
throws Exception
@@ -89,8 +94,7 @@
/**
* Store the RuntimeServices before the object is initialized..
- * @param rs
- * @throws Exception
+ * @param rs RuntimeServices object for initialization
*/
public void setRuntimeServices(RuntimeServices rs)
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]