public static Field getField(Class<?> clazz, String fieldName) {
        Assert.notNull(clazz, "clazz不能为空");
        Assert.notNull(fieldName, "fieldName不能为空");
        return FIELD_CACHE.compute(new FieldKey(fieldName, clazz), (k, v) -> {
            if (v == null) {
                try {
                    return allowAccess(clazz.getDeclaredField(fieldName));
                } catch (NoSuchFieldException e) {
                    log.error(StringUtils.format("类[{0}]中不存在字段[{1}]", clazz, fieldName));
                    throw new ReflectException(
                        StringUtils.format("类[{0}]中不存在字段[{1}]", clazz, fieldName), e);
                }
            } else {
                return v;
            }
        });
    }
public static Field getField ( Class < ? > clazz , String fieldName ) { Assert . notNull ( clazz , "clazz不能为空" ) ; Assert . notNull ( fieldName , "fieldName不能为空" ) ; return FIELD_CACHE . compute ( new FieldKey ( fieldName , clazz ) , ( k , v ) -> { if ( v == null ) { try { return allowAccess ( clazz . getDeclaredField ( fieldName ) ) ; } catch ( NoSuchFieldException e ) { log . error ( StringUtils . format ( "类[{0}]中不存在字段[{1}]" , clazz , fieldName ) ) ; throw new ReflectException ( StringUtils . format ( "类[{0}]中不存在字段[{1}]" , clazz , fieldName ) , e ) ; } } else { return v ; } } ) ; }
从指定Class中获取指定Field，并尝试将其accessible属性设置为true（并不能获取到父类声明的字段）
@param clazz Class
@param fieldName fieldName
@return Field，不会为null，只会抛出异常