public static Field findField(Class<?> clazz, String fieldName) {
        String fullFieldName = clazz.getName() + '#' + fieldName;

        if (FIELD_CACHE.containsKey(fullFieldName)) {
            Field field = FIELD_CACHE.get(fullFieldName);
            if (field == null) {
                throw new NoSuchFieldError(fullFieldName);
            }
            return field;
        }

        try {
            Field field = findFieldRecursiveImpl(clazz, fieldName);
            field.setAccessible(true);
            FIELD_CACHE.put(fullFieldName, field);
            return field;
        } catch (NoSuchFieldException e) {
            FIELD_CACHE.put(fullFieldName, null);
            throw new NoSuchFieldError(fullFieldName);
        }
    }
Look up a field in a class and set it to accessible.

@param clazz     The class which either declares or inherits the field.
@param fieldName The field name.
@return A reference to the field.
@throws NoSuchFieldError In case the field was not found.
android/android_framework/base/src/main/java/util/ReflectionUtils.java