MCPcopy Create free account
hub / github.com/VolmitSoftware/Adapt / getField

Method getField

src/main/java/com/volmit/adapt/util/Violator.java:109–128  ·  view source on GitHub ↗
(Class<?> c, String name)

Source from the content-addressed store, hash-verified

107 }
108
109 @SuppressWarnings("rawtypes")
110 public static Field getField(Class<?> c, String name) throws Throwable {
111 if (!h(id(c, null) + "." + name)) {
112 try {
113 Field f = c.getField(name);
114 f.setAccessible(true);
115 p(id(c, null) + "." + name, f);
116 } catch (NoSuchFieldException e) {
117 Class s = c.getSuperclass();
118 if (null == s) {
119 throw e;
120 }
121 Field f = s.getField(name);
122 f.setAccessible(true);
123 p(id(c, null) + "." + name, f);
124 }
125 }
126
127 return (Field) g(id(c, null) + "." + name);
128 }
129
130 @SuppressWarnings("rawtypes")
131 public static Field getDeclaredField(Class<?> c, String name) throws Throwable {

Callers 4

getMethod · 0.95
setMethod · 0.95
JSONObjectMethod · 0.45

Calls 4

hMethod · 0.95
idMethod · 0.95
pMethod · 0.95
gMethod · 0.95

Tested by

no test coverage detected