@CheckForNull
    public static Field getFieldNoForce(final Class cls, String fieldName) {
        if (cls == null) {
            throw new IllegalArgumentException("The class must not be null");
        }
        if (fieldName == null) {
            throw new IllegalArgumentException("The field name must not be null");
        }
        // Sun Java 1.3 has a bugged implementation of getField hence we write the
        // code ourselves

        // getField() will return the Field object with the declaring class
        // set correctly to the class that declares the field. Thus requesting the
        // field on a subclass will return the field from the superclass.
        //
        // priority order for lookup:
        // searchclass private/protected/package/public
        // superclass protected/package/public
        //  private/different package blocks access to further superclasses
        // implementedinterface public

        // check up the superclass hierarchy
        for (Class acls = cls; acls != null; acls = acls.getSuperclass()) {
            try {
                Field field = acls.getDeclaredField(fieldName);
                // getDeclaredField checks for non-public scopes, and we return it to upstream
                return field;
            } catch (NoSuchFieldException ex) {
                // ignore
            }
        }
        // check the public interface case. This must be manually searched for
        // incase there is a public supersuperclass field hidden by a private/package
        // superclass field.
        Field match = null;
        for (Iterator intf = ClassUtils.getAllInterfaces(cls).iterator(); intf.hasNext(); ) {
            try {
                Field test = ((Class) intf.next()).getField(fieldName);
                if (match != null) {
                    throw new IllegalArgumentException("Reference to field "
                            + fieldName
                            + " is ambiguous relative to "
                            + cls
                            + "; a matching field exists on two or more implemented interfaces.");
                }
                match = test;
            } catch (NoSuchFieldException ex) {
                // ignore
            }
        }
        return match;
    }
Gets an accessible <code>Field</code> by name without breaking scope.
Superclasses/interfaces will be considered.
This is an equivalent of {@link #getField(Class, String, boolean)} from the commons lang library,
but without {@link Field#setAccessible(boolean)} invocation.

@param cls  the class to reflect, must not be null
@param fieldName  the field name to obtain
@return the Field object, it might be {@code null}
@throws IllegalArgumentException if the class or field name is null
plugin/src/main/java/io/jenkins/plugins/casc/util/ExtraFieldUtils.java