Gets all the normal object methods of this class for the given name. @return object methods available from this class for given name
(final Class<?> sender, final String name, final boolean isCallToSuper)
| 749 | * @return object methods available from this class for given name |
| 750 | */ |
| 751 | private Object getMethods(final Class<?> sender, final String name, final boolean isCallToSuper) { |
| 752 | Object answer; |
| 753 | |
| 754 | var entry = metaMethodIndex.getMethods( sender , name); |
| 755 | if (entry == null && !isGroovyFunctor()) { |
| 756 | entry = metaMethodIndex.getMethods(theClass, name); |
| 757 | } |
| 758 | if (entry == null) { |
| 759 | answer = FastArray.EMPTY_LIST; |
| 760 | } else if (isCallToSuper) { |
| 761 | answer = entry.methodsForSuper; |
| 762 | } else { |
| 763 | answer = entry.methods; |
| 764 | } |
| 765 | |
| 766 | if (answer == null) answer = FastArray.EMPTY_LIST; |
| 767 | |
| 768 | if (!isCallToSuper) { |
| 769 | List<CategoryMethod> methods = GroovyCategorySupport.getCategoryMethods(name); |
| 770 | if (methods != null) { |
| 771 | FastArray array; |
| 772 | if (answer instanceof FastArray fastArray) { |
| 773 | array = fastArray.copy(); |
| 774 | } else { |
| 775 | array = new FastArray(); |
| 776 | array.add(answer); |
| 777 | } |
| 778 | for (CategoryMethod cm : methods) { |
| 779 | Class<?> cmdc = cm.getDeclaringClass().getTheClass(); |
| 780 | if (cmdc == Object.class ? !isGroovyFunctor() // GROOVY-7685 |
| 781 | : cmdc.isAssignableFrom(theClass)) // GROOVY-11813 |
| 782 | filterMatchingMethodForCategory(array, cm); |
| 783 | } |
| 784 | answer = array; |
| 785 | } |
| 786 | } |
| 787 | return answer; |
| 788 | } |
| 789 | |
| 790 | /** |
| 791 | * Gets all the normal static methods of this class for the given name. |
no test coverage detected