(Object target, String fieldName)
| 409 | } |
| 410 | |
| 411 | public 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 | |
| 429 | public static Object setInstanceField(Object target, String fieldName, Object val) { |
| 430 | Class c = target.getClass(); |
no test coverage detected