MCPcopy Create free account
hub / github.com/GraxCode/zelixkiller / findMethodParent

Method findMethodParent

src/me/lpk/util/ParentUtils.java:65–82  ·  view source on GitHub ↗

Returns the method in the given class's parent with the name and description. If it's not in the given class, further parents are checked. Returns null if nothing is found. @param owner @param name @param desc @return

(MappedClass owner, String name, String desc, boolean originalNames)

Source from the content-addressed store, hash-verified

63 * @return
64 */
65 public static List<MappedMember> findMethodParent(MappedClass owner, String name, String desc, boolean originalNames) {
66 List<MappedMember> list = new ArrayList<MappedMember>();
67 // Check for interfaces in the method's class.
68 for (MappedClass interfaceClass : owner.getInterfaces()) {
69 MappedMember mm = findMethodInParentInclusive(interfaceClass, name, desc,originalNames);
70 if (mm != null) {
71 list.add(mm);
72 }
73 }
74 // Check the parents
75 if (owner.getParent() != null) {
76 MappedMember mm = findMethodInParentInclusive(owner.getParent(), name, desc,originalNames);
77 if (mm != null) {
78 list.add(mm);
79 }
80 }
81 return list;
82 }
83
84 public static MappedMember findMethodInParentInclusive(MappedClass owner, String name, String desc, boolean originalNames) {
85 for (MappedMember mm : owner.getMethods()) {

Callers

nothing calls this directly

Calls 3

getInterfacesMethod · 0.80
getParentMethod · 0.45

Tested by

no test coverage detected