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

Method findFieldInParent

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

Returns the field 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

131 * @return
132 */
133 public static MappedMember findFieldInParent(MappedClass owner, String name, String desc, boolean originalNames) {
134
135 // Check for interfaces in the field's class.
136 for (MappedClass interfaceClass : owner.getInterfaces()) {
137 MappedMember mm = findFieldInParentInclusive(interfaceClass, name, desc, originalNames);
138 if (mm != null) {
139 return mm;
140 }
141 }
142 // Check the parents
143 if (owner.getParent() != null) {
144 MappedMember mm = findFieldInParentInclusive(owner.getParent(), name, desc, originalNames);
145 if (mm != null) {
146 return mm;
147 }
148 }
149 return null;
150 }
151
152 public static MappedMember findFieldInParentInclusive(MappedClass owner, String name, String desc, boolean originalNames) {
153 // Check the class itself

Callers

nothing calls this directly

Calls 3

getInterfacesMethod · 0.80
getParentMethod · 0.45

Tested by

no test coverage detected