(Class c, Method m, Object target)
| 253 | } |
| 254 | |
| 255 | public static Method getAsMethodOfAccessibleBase(Class c, Method m, Object target){ |
| 256 | for(Class iface : c.getInterfaces()) |
| 257 | { |
| 258 | for(Method im : iface.getMethods()) |
| 259 | { |
| 260 | if(isAccessibleMatch(im, m, target)) |
| 261 | { |
| 262 | return im; |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | Class sc = c.getSuperclass(); |
| 267 | if(sc == null) |
| 268 | return null; |
| 269 | for(Method scm : sc.getMethods()) |
| 270 | { |
| 271 | if(isAccessibleMatch(scm, m, target)) |
| 272 | { |
| 273 | return scm; |
| 274 | } |
| 275 | } |
| 276 | return getAsMethodOfAccessibleBase(sc, m, target); |
| 277 | } |
| 278 | |
| 279 | public static boolean isAccessibleMatch(Method lhs, Method rhs, Object target) { |
| 280 | if(!lhs.getName().equals(rhs.getName()) |
no test coverage detected