MCPcopy Index your code
hub / github.com/clojure/clojure / getInstanceField

Method getInstanceField

src/jvm/clojure/lang/Reflector.java:411–427  ·  view source on GitHub ↗
(Object target, String fieldName)

Source from the content-addressed store, hash-verified

409}
410
411public static Object getInstanceField(Object target, String fieldName) {
412 Class c = target.getClass();
413 Field f = getField(c, fieldName, false);
414 if(f != null)
415 {
416 try
417 {
418 return prepRet(f.getType(), f.get(target));
419 }
420 catch(IllegalAccessException e)
421 {
422 throw Util.sneakyThrow(e);
423 }
424 }
425 throw new IllegalArgumentException("No matching field found: " + fieldName
426 + " for " + target.getClass());
427}
428
429public static Object setInstanceField(Object target, String fieldName, Object val) {
430 Class c = target.getClass();

Callers 2

emitValueMethod · 0.95

Calls 5

getFieldMethod · 0.95
prepRetMethod · 0.95
sneakyThrowMethod · 0.95
getMethod · 0.65
getTypeMethod · 0.45

Tested by

no test coverage detected