fullRuntime/src/sc/type/RTypeUtil.java
public static Method pickMoreSpecificMethod(Method res, Method toCheck, Class[] argTypes) {
      if (res == null)
         return toCheck;

      if (argTypes != null) {

         Class[] resParams = res.getParameterTypes();
         Class[] tcParams = toCheck.getParameterTypes();

         for (int i = 0; i < resParams.length; i++) {
            Class arg = argTypes[i];
            Class resArg = resParams[i];
            Class tcArg = tcParams[i];
            sc.type.Type resType = sc.type.Type.get(resArg);
            sc.type.Type tcType = sc.type.Type.get(tcArg);
            sc.type.Type argType = sc.type.Type.get(arg);

            if (resArg == tcArg)
               continue;

            if (argType == resType)
               return res;
            if (argType == tcType)
               return toCheck;

            if (resArg.isAssignableFrom(tcArg))
               return toCheck;
            return res;
         }
      }

      if (toCheck.getReturnType().isAssignableFrom(res.getReturnType()))
         return res;
      return toCheck;
   }
/** Chooses the method with the more specific return type - as per the searchMethods method in java.lang.Class */
Chooses the method with the more specific return type - as per the searchMethods method in java.lang.Class
Chooses the method with the more specific return type - as per the searchMethods method in java . lang . Class
public static Method pickMoreSpecificMethod(Method res, Method toCheck, Class[] argTypes) {
      if (res == null)
         return toCheck;
      if (argTypes != null) {
         Class[] resParams = res.getParameterTypes();
         Class[] tcParams = toCheck.getParameterTypes();
         for (int i = 0; i < resParams.length; i++) {
            Class arg = argTypes[i];
            Class resArg = resParams[i];
            Class tcArg = tcParams[i];
            sc.type.Type resType = sc.type.Type.get(resArg);
            sc.type.Type tcType = sc.type.Type.get(tcArg);
            sc.type.Type argType = sc.type.Type.get(arg);
            if (resArg == tcArg)
               continue;
            if (argType == resType)
               return res;
            if (argType == tcType)
               return toCheck;
            if (resArg.isAssignableFrom(tcArg))
               return toCheck;
            return res;
         }
      }
      if (toCheck.getReturnType().isAssignableFrom(res.getReturnType()))
         return res;
      return toCheck;
   }
public static Method pickMoreSpecificMethod ( Method res , Method toCheck , Class [ ] argTypes ) { if ( res == null ) return toCheck ; if ( argTypes != null ) { Class [ ] resParams = res . getParameterTypes ( ) ; Class [ ] tcParams = toCheck . getParameterTypes ( ) ; for ( int i = 0 ; i < resParams . length ; i ++ ) { Class arg = argTypes [ i ] ; Class resArg = resParams [ i ] ; Class tcArg = tcParams [ i ] ; sc . type . Type resType = sc . type . Type . get ( resArg ) ; sc . type . Type tcType = sc . type . Type . get ( tcArg ) ; sc . type . Type argType = sc . type . Type . get ( arg ) ; if ( resArg == tcArg ) continue ; if ( argType == resType ) return res ; if ( argType == tcType ) return toCheck ; if ( resArg . isAssignableFrom ( tcArg ) ) return toCheck ; return res ; } } if ( toCheck . getReturnType ( ) . isAssignableFrom ( res . getReturnType ( ) ) ) return res ; return toCheck ; }
Chooses the method with the more specific return type - as per the searchMethods method in java.lang.Class
Chooses the method with the more specific return type - as per the searchMethods method in java . lang . Class