(Method lhs, Method rhs)
| 229 | |
| 230 | // DEPRECATED - replaced by isAccessibleMatch() |
| 231 | public static boolean isMatch(Method lhs, Method rhs) { |
| 232 | if(!lhs.getName().equals(rhs.getName()) |
| 233 | || !Modifier.isPublic(lhs.getDeclaringClass().getModifiers())) |
| 234 | { |
| 235 | return false; |
| 236 | } |
| 237 | |
| 238 | Class[] types1 = lhs.getParameterTypes(); |
| 239 | Class[] types2 = rhs.getParameterTypes(); |
| 240 | if(types1.length != types2.length) |
| 241 | return false; |
| 242 | |
| 243 | boolean match = true; |
| 244 | for (int i=0; i<types1.length; ++i) |
| 245 | { |
| 246 | if(!types1[i].isAssignableFrom(types2[i])) |
| 247 | { |
| 248 | match = false; |
| 249 | break; |
| 250 | } |
| 251 | } |
| 252 | return match; |
| 253 | } |
| 254 | |
| 255 | public static Method getAsMethodOfAccessibleBase(Class c, Method m, Object target){ |
| 256 | for(Class iface : c.getInterfaces()) |
no test coverage detected