code: public static Object invoke(Object object, String methodName, Object[] parameters) {
          try {
              Class[] classTypes = new Class[parameters.length];
              for (int i = 0; i < classTypes.length; i++) {
                  classTypes[i] = parameters[i].getClass();
              }
              Method method = object.getClass().getMethod(methodName, classTypes);
              return method.invoke(object, parameters);
          } catch (Throwable t) {
              return InvokerHelper.invokeMethod(object, methodName,  parameters);
          }
      }
docs: Invoke a method through reflection.
  Falls through to using the Invoker to call the method in case the reflection call fails..
  
  @param object the object on which to invoke a method
  @param methodName the name of the method to invoke
  @param parameters the parameters of the method call
  @return the result of the method call