(Class c, int arity, String name, boolean getStatics)
| 524 | } |
| 525 | |
| 526 | static public List<Method> getMethods(Class c, int arity, String name, boolean getStatics){ |
| 527 | Method[] allmethods = c.getMethods(); |
| 528 | ArrayList methods = new ArrayList(); |
| 529 | ArrayList bridgeMethods = new ArrayList(); |
| 530 | for(int i = 0; i < allmethods.length; i++) |
| 531 | { |
| 532 | Method method = allmethods[i]; |
| 533 | if(name.equals(method.getName()) |
| 534 | && Modifier.isStatic(method.getModifiers()) == getStatics |
| 535 | && method.getParameterTypes().length == arity) |
| 536 | { |
| 537 | try |
| 538 | { |
| 539 | if(method.isBridge() |
| 540 | && c.getMethod(method.getName(), method.getParameterTypes()) |
| 541 | .equals(method)) |
| 542 | bridgeMethods.add(method); |
| 543 | else |
| 544 | methods.add(method); |
| 545 | } |
| 546 | catch(NoSuchMethodException e) |
| 547 | { |
| 548 | } |
| 549 | } |
| 550 | // && (!method.isBridge() |
| 551 | // || (c == StringBuilder.class && |
| 552 | // c.getMethod(method.getName(), method.getParameterTypes()) |
| 553 | // .equals(method)))) |
| 554 | // { |
| 555 | // methods.add(allmethods[i]); |
| 556 | // } |
| 557 | } |
| 558 | |
| 559 | if(methods.isEmpty()) |
| 560 | methods.addAll(bridgeMethods); |
| 561 | |
| 562 | if(!getStatics && c.isInterface()) |
| 563 | { |
| 564 | allmethods = Object.class.getMethods(); |
| 565 | for(int i = 0; i < allmethods.length; i++) |
| 566 | { |
| 567 | if(name.equals(allmethods[i].getName()) |
| 568 | && Modifier.isStatic(allmethods[i].getModifiers()) == getStatics |
| 569 | && allmethods[i].getParameterTypes().length == arity) |
| 570 | { |
| 571 | methods.add(allmethods[i]); |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | return methods; |
| 576 | } |
| 577 | |
| 578 | // Return type coercions match coercions in FnInvokers for compiled invokers |
| 579 | private static Object coerceAdapterReturn(Object ret, Class targetType) { |
no test coverage detected