(Method lhs, Method rhs, Object target)
| 277 | } |
| 278 | |
| 279 | public static boolean isAccessibleMatch(Method lhs, Method rhs, Object target) { |
| 280 | if(!lhs.getName().equals(rhs.getName()) |
| 281 | || !Modifier.isPublic(lhs.getDeclaringClass().getModifiers()) |
| 282 | || !canAccess(lhs, target)) |
| 283 | { |
| 284 | return false; |
| 285 | } |
| 286 | |
| 287 | Class[] types1 = lhs.getParameterTypes(); |
| 288 | Class[] types2 = rhs.getParameterTypes(); |
| 289 | if(types1.length != types2.length) |
| 290 | return false; |
| 291 | |
| 292 | boolean match = true; |
| 293 | for (int i=0; i<types1.length; ++i) |
| 294 | { |
| 295 | if(!types1[i].isAssignableFrom(types2[i])) |
| 296 | { |
| 297 | match = false; |
| 298 | break; |
| 299 | } |
| 300 | } |
| 301 | return match; |
| 302 | } |
| 303 | |
| 304 | public static Object invokeConstructor(Class c, Object[] args) { |
| 305 | try |
no test coverage detected