MCPcopy Create free account
hub / github.com/cinit/TMoe / getFirstNSFFieldByType

Method getFirstNSFFieldByType

app/src/main/java/cc/ioctl/tmoe/util/Reflex.java:1166–1188  ·  view source on GitHub ↗
(Class clz, Class type)

Source from the content-addressed store, hash-verified

1164 */
1165 //@Deprecated
1166 public static Field getFirstNSFFieldByType(Class clz, Class type) {
1167 if (clz == null) {
1168 throw new NullPointerException("clz == null");
1169 }
1170 if (type == null) {
1171 throw new NullPointerException("type == null");
1172 }
1173 while (clz != null && !clz.equals(Object.class)) {
1174 for (Field f : clz.getDeclaredFields()) {
1175 if (!f.getType().equals(type)) {
1176 continue;
1177 }
1178 int m = f.getModifiers();
1179 if (Modifier.isStatic(m) || Modifier.isFinal(m)) {
1180 continue;
1181 }
1182 f.setAccessible(true);
1183 return f;
1184 }
1185 clz = clz.getSuperclass();
1186 }
1187 return null;
1188 }
1189
1190 @NonNull
1191 public static String getShortClassName(Object obj) {

Callers

nothing calls this directly

Calls 1

equalsMethod · 0.45

Tested by

no test coverage detected