ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject svn commit: r564910 - /ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java
Date Sat, 11 Aug 2007 12:49:19 GMT
Author: peterreilly
Date: Sat Aug 11 05:49:18 2007
New Revision: 564910

URL: http://svn.apache.org/viewvc?view=rev&rev=564910
Log:
checkstyle

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java?view=diff&rev=564910&r1=564909&r2=564910
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/ReflectUtil.java Sat Aug 11 05:49:18
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: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message