Author: peterreilly
Date: Sat Aug 11 05:49:34 2007
New Revision: 564911
URL: http://svn.apache.org/viewvc?view=rev&rev=564911
Log:
merge
Modified:
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/ReflectUtil.java
Modified:
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/ReflectUtil.java
URL:
http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/ReflectUtil.java?view=diff&rev=564911&r1=564910&r2=564911
==============================================================================
---
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/ReflectUtil.java
(original)
+++
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/util/ReflectUtil.java
Sat Aug 11 05:49:34 2007
@@ -28,7 +28,7 @@
* methods, catch any exceptions, converting them
* to BuildExceptions.
*/
-
+// CheckStyle:FinalClassCheck OFF - backward compatible
public class ReflectUtil {
/** private constructor */
@@ -64,7 +64,7 @@
public static Object invokeStatic(Object obj, String methodName) {
try {
Method method;
- method = ((Class)obj).getMethod(
+ method = ((Class) obj).getMethod(
methodName, (Class[]) null);
return method.invoke(obj, (Object[]) null);
} catch (Exception t) {
@@ -152,6 +152,7 @@
* A method to convert an invocationTargetException to
* a buildexception.
* @param t the invocation target exception.
+ * @return the converted exception.
* @since ant 1.7.1
*/
public static BuildException toBuildException(Exception t) {
@@ -172,20 +173,20 @@
* message (method call)
* @param o the object
* @param methodName the method to check for
- * @return
- * @throws BuildException
+ * @return true if the object has the method.
+ * @throws BuildException if there is a problem.
*/
public static boolean respondsTo(Object o, String methodName)
throws BuildException {
try {
Method[] methods = o.getClass().getMethods();
- for(int i=0; i<methods.length; i++) {
- if(methods[i].getName().equals(methodName)) {
+ for (int i = 0; i < methods.length; i++) {
+ if (methods[i].getName().equals(methodName)) {
return true;
}
}
return false;
- } catch(Exception t) {
+ } catch (Exception t) {
throw toBuildException(t);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]