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

Method setInstanceField

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

Source from the content-addressed store, hash-verified

427}
428
429public static Object setInstanceField(Object target, String fieldName, Object val) {
430 Class c = target.getClass();
431 Field f = getField(c, fieldName, false);
432 if(f != null)
433 {
434 try
435 {
436 f.set(target, boxArg(f.getType(), val));
437 }
438 catch(IllegalAccessException e)
439 {
440 throw Util.sneakyThrow(e);
441 }
442 return val;
443 }
444 throw new IllegalArgumentException("No matching field found: " + fieldName
445 + " for " + target.getClass());
446}
447
448// not used as of Clojure 1.6, but left for runtime compatibility with
449// compiled bytecode from older versions

Callers 1

evalAssignMethod · 0.95

Calls 5

getFieldMethod · 0.95
boxArgMethod · 0.95
sneakyThrowMethod · 0.95
setMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected