(Class<?> clazz, Class returnType, Class... argt)
| 1029 | } |
| 1030 | |
| 1031 | public static Method findMethodByTypes_1(Class<?> clazz, Class returnType, Class... argt) |
| 1032 | throws NoSuchMethodException { |
| 1033 | Method method = null; |
| 1034 | Method[] m; |
| 1035 | Class[] _argt; |
| 1036 | loop_main: |
| 1037 | do { |
| 1038 | m = clazz.getDeclaredMethods(); |
| 1039 | loop: |
| 1040 | for (Method value : m) { |
| 1041 | _argt = value.getParameterTypes(); |
| 1042 | if (_argt.length == argt.length) { |
| 1043 | for (int ii = 0; ii < argt.length; ii++) { |
| 1044 | if (!argt[ii].equals(_argt[ii])) { |
| 1045 | continue loop; |
| 1046 | } |
| 1047 | } |
| 1048 | if (returnType != null && !returnType.equals(value.getReturnType())) { |
| 1049 | continue; |
| 1050 | } |
| 1051 | if (method == null) { |
| 1052 | method = value; |
| 1053 | //here we go through this class |
| 1054 | } else { |
| 1055 | throw new NoSuchMethodException( |
| 1056 | "Multiple methods found for __attribute__((any))" + paramsTypesToString( |
| 1057 | argt) + " in " + clazz.getName()); |
| 1058 | } |
| 1059 | } |
| 1060 | } |
| 1061 | } while (method == null && !Object.class.equals(clazz = clazz.getSuperclass())); |
| 1062 | if (method == null) { |
| 1063 | throw new NoSuchMethodException( |
| 1064 | "__attribute__((a))" + paramsTypesToString(argt) + " in " + clazz.getName()); |
| 1065 | } |
| 1066 | method.setAccessible(true); |
| 1067 | return method; |
| 1068 | } |
| 1069 | |
| 1070 | public static Field hasField(Object obj, String name) throws ReflectiveOperationException { |
| 1071 | return hasField(obj, name, null); |
nothing calls this directly
no test coverage detected