Apply javadoc fixes. VELOCITY-475.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/velocity/engine/trunk@470261 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/java/org/apache/velocity/util/introspection/ClassMap.java b/src/java/org/apache/velocity/util/introspection/ClassMap.java
index 9b8975b..855584c 100644
--- a/src/java/org/apache/velocity/util/introspection/ClassMap.java
+++ b/src/java/org/apache/velocity/util/introspection/ClassMap.java
@@ -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)
{
diff --git a/src/java/org/apache/velocity/util/introspection/MethodMap.java b/src/java/org/apache/velocity/util/introspection/MethodMap.java
index 5b5b38d..6362dc6 100644
--- a/src/java/org/apache/velocity/util/introspection/MethodMap.java
+++ b/src/java/org/apache/velocity/util/introspection/MethodMap.java
@@ -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)
{
diff --git a/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java b/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java
index 09080e7..a21133c 100644
--- a/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java
+++ b/src/java/org/apache/velocity/util/introspection/SecureIntrospectorControl.java
@@ -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
diff --git a/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java b/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java
index cd9456d..beb6a72 100644
--- a/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java
+++ b/src/java/org/apache/velocity/util/introspection/SecureIntrospectorImpl.java
@@ -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;
}
diff --git a/src/java/org/apache/velocity/util/introspection/SecureUberspector.java b/src/java/org/apache/velocity/util/introspection/SecureUberspector.java
index 78fd2ef..b0d0bda 100644
--- a/src/java/org/apache/velocity/util/introspection/SecureUberspector.java
+++ b/src/java/org/apache/velocity/util/introspection/SecureUberspector.java
@@ -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)
{