code: public static void setFieldValue(Object object, Class<?> clazz, String fieldName, Object value)
    {
      Field field = getField(clazz, fieldName);
      if(object == null ^ Modifier.isStatic(field.getModifiers())) {
        throw new BugError("Cannot access static field |%s| from instance |%s|.", fieldName, clazz);
      }
      setFieldValue(object, field, value);
    }
docs: Set instance field declared into superclass. Try to set field value throwing exception if field is not declared
  into superclass; if field is static object instance should be null.
  
  @param object instance to set field value to or null if field is static,
  @param clazz instance superclass where field is declared,
  @param fieldName field name,
  @param value field value.
  @throws NoSuchBeingException if field not found.
  @throws BugError if object is null and field is not static or if object is not null and field is static.