static Executable mapMethod()

in TransformCore/src/main/java/com/facebook/ads/injkit/ReflectUtils.java [74:99]


  static Executable mapMethod(Executable method, Class<?> inClass) {
    if (inClass == null) {
      return null;
    }

    try {
      if (Modifier.isStatic(method.getModifiers())) {
        return null;
      }

      if (method instanceof Method) {
        Method m = inClass.getDeclaredMethod(method.getName(), method.getParameterTypes());
        if (Modifier.isPrivate(m.getModifiers()) || Modifier.isStatic(m.getModifiers())) {
          return null;
        }

        return m;
      } else {
        // Constructors are not mapped.
        return null;
      }

    } catch (NoSuchMethodException e) {
      return null;
    }
  }