Пример #1
0
  private static void handleException(
      Throwable e, ReflectorConstructor refConstr, Object[] params) {
    if ((e instanceof InvocationTargetException)) {
      e.printStackTrace();
      return;
    }
    if ((e instanceof IllegalArgumentException)) {
      Config.warn("*** IllegalArgumentException ***");
      Config.warn("Constructor: " + refConstr.getTargetConstructor());

      Config.warn("Parameter classes: " + Config.arrayToString(getClasses(params)));
      Config.warn("Parameters: " + Config.arrayToString(params));
    }
    Config.warn("*** Exception outside of constructor ***");
    Config.warn("Constructor deactivated: " + refConstr.getTargetConstructor());
    refConstr.deactivate();

    e.printStackTrace();
  }
Пример #2
0
  private static void handleException(
      Throwable e, Object obj, ReflectorMethod refMethod, Object[] params) {
    if ((e instanceof InvocationTargetException)) {
      e.printStackTrace();
      return;
    }
    if ((e instanceof IllegalArgumentException)) {
      Config.warn("*** IllegalArgumentException ***");
      Config.warn("Method: " + refMethod.getTargetMethod());

      Config.warn("Object: " + obj);

      Config.warn("Parameter classes: " + Config.arrayToString(getClasses(params)));
      Config.warn("Parameters: " + Config.arrayToString(params));
    }
    Config.warn("*** Exception outside of method ***");
    Config.warn("Method deactivated: " + refMethod.getTargetMethod());
    refMethod.deactivate();

    e.printStackTrace();
  }
Пример #3
0
 private static void dbgCallVoid(
     boolean isStatic, String callType, ReflectorMethod refMethod, Object[] params) {
   String className = refMethod.getTargetMethod().getDeclaringClass().getName();
   String methodName = refMethod.getTargetMethod().getName();
   String staticStr = "";
   if (isStatic) {
     staticStr = " static";
   }
   Config.dbg(
       callType
           + staticStr
           + " "
           + className
           + "."
           + methodName
           + "("
           + Config.arrayToString(params)
           + ")");
 }