private static String invoke16Method(Object obj,Class<?> type,String method,Class<?> retType){
  if (!VersionUtils.isJava16OrAbove())   return "-1";
  try {
    Method m=type.getMethod(method);
    Object ret=m.invoke(obj);
    if (ret == null)     return "-7";
    if (!(retType.isAssignableFrom(ret.getClass())))     return "-5";
    return ret.toString();
  }
 catch (  NoSuchMethodException bail) {
    return "-2";
  }
catch (  IllegalAccessException bail) {
    return "-3";
  }
catch (  InvocationTargetException bail) {
    return "-4";
  }
catch (  Throwable bad) {
    return "-6";
  }
}

private static String invoke16Method ( Object obj , Class < ? > type , String method , Class < ? > retType ) { if ( ! VersionUtils . isJava16OrAbove ( ) ) return "-1" ; try { Method m = type . getMethod ( method ) ; Object ret = m . invoke ( obj ) ; if ( ret == null ) return "-7" ; if ( ! ( retType . isAssignableFrom ( ret . getClass ( ) ) ) ) return "-5" ; return ret . toString ( ) ; } catch ( NoSuchMethodException bail ) { return "-2" ; } catch ( IllegalAccessException bail ) { return "-3" ; } catch ( InvocationTargetException bail ) { return "-4" ; } catch ( Throwable bad ) { return "-6" ; } }
attempts to run the given method if it exists running on java 1 . 6 or above . this can only be used for calling methods with no parameters .
