Returns the specified field found on the specified class and its ancestors.

@param someClass the class to search the field on.
@param fieldName the field name.
@return the corresponding field object wrapped in an optional.
344578
public static Optional<Field> resolveField(Class<?> someClass, String fieldName) {
        return fieldCache.get(new FieldReference(someClass, fieldName));
    }
720298
public Method getGetter(String fieldName) {
		final PropDesc desc = this.propMap.get(fieldName);
		return null == desc ? null : desc.getGetter();
	}
759931
public static Field findField(Class<?> type, String name) {
		while (type != null) {
			for (Field field : type.getDeclaredFields()) {
				if (field.getName().equals(name)) {
					return field;
				}
			}
			type = type.getSuperclass();
		}
		return null;
	}
1264978
public static Field getOptionalField(Class<?> clazz, String fieldName)
  {
    try {
      Field field = clazz.getDeclaredField(fieldName);
      field.setAccessible(true);
      return field;
    }
    catch(NoSuchFieldException expectable) {}
    catch(SecurityException e) {
      throw new BugError(e);
    }
    return null;
  }
539947
public Field loadClassAndGetField() throws IllegalArgumentException {
        try {
            return loadClass().getField(getName());
        } catch (final NoSuchFieldException e1) {
            try {
                return loadClass().getDeclaredField(getName());
            } catch (final NoSuchFieldException e2) {
                throw new IllegalArgumentException("No such field: " + getClassName() + "." + getName());
            }
        }
    }
869171
public static Field getDeclaredFieldInHierarchy(Class<?> clazz, String fieldName) throws NoSuchFieldException {
		
		Field field = null;
		for (Class<?> acls = clazz; acls != null; acls = acls.getSuperclass()) {
			try {
				field = acls.getDeclaredField(fieldName);
				break;
			} catch (NoSuchFieldException e) {
				// ignore
			}
		}
		if (field == null) {
			throw new NoSuchFieldException("Could not find field '" + fieldName + "' in class '" + clazz.getName() + "' or its super classes");
		}
		
		return field;
	}
440558
public <T> T getField(String fieldName, Class<T> clazz) {
        return DPathUtils.getValue(fieldData, fieldName, clazz);
    }
194512
private static Field getField(String fieldName, Class<?> where) {
        if (where == null) {
            throw new IllegalArgumentException("where cannot be null");
        }

        Field field = null;
        try {
            field = where.getDeclaredField(fieldName);
            field.setAccessible(true);
        } catch (NoSuchFieldException e) {
            throw new FieldNotFoundException("Field '" + fieldName + "' was not found in class " + where.getName()
                                                     + ".");
        }
        return field;
    }
1263726
public static final String getter(Field field, String fieldName)
    {
        Class<?> type = field.getType();
        if (type.isPrimitive() && "boolean".equals(type.getName()))
        {
            return isser(fieldName);
        }
        else
        {
            return getter(fieldName);
        }
    }
294952
public Field getField(String name) {
    FieldInfo fieldInfo = getFieldInfo(name);
    return fieldInfo == null ? null : fieldInfo.getField();
  }
1238328
public static Field lookupField( Class parentClass, String fieldName )
    {
        try {
            return parentClass.getDeclaredField( fieldName );
        }
        catch ( NoSuchFieldException e ) {
            Class superClass = parentClass.getSuperclass();
            return superClass != null ? lookupField( superClass, fieldName ) : null;
        }
    }
782982
public static Field getField(Class<?> beanClass, String name) throws SecurityException {
		final Field[] fields = getFields(beanClass);
		if (ArrayUtil.isNotEmpty(fields)) {
			for (Field field : fields) {
				if ((name.equals(field.getName()))) {
					return field;
				}
			}
		}
		return null;
	}
658316
public BaseField getField(String strTableName, int iFieldSeq)   // Lookup this field
    {
        if (this.getRecord(strTableName) != this)
            return null;
        return this.getField(iFieldSeq);
    }
602477
public boolean usesField(String className, String fieldName) {
		int classIndex = findClass(className);
		if (classIndex == NOT_FOUND) return false;
		int fieldNameIndex = findUtf8(fieldName);
		if (fieldNameIndex == NOT_FOUND) return false;
		
		for (int i = 1; i < maxPoolSize; i++) {
			if (types[i] == FIELD && readValue(offsets[i]) == classIndex) {
				int nameAndTypeIndex = readValue(offsets[i] + 2);
				if (readValue(offsets[nameAndTypeIndex]) == fieldNameIndex) return true;
			}
		}
		return false;
	}
528893
public static Field getField(Class clazz, String fieldName)
    {
        try
        {
            return clazz.getField(fieldName);
        }
        catch (Exception ignored)
        {}
        return null;
    }
1288429
public static Field findField(Class<?> clazz, String name) {
        Class<?> entityClass = clazz;
        while (!Object.class.equals(entityClass) && entityClass != null) {
            Field[] fields = entityClass.getDeclaredFields();
            for (Field field : fields) {
                if (name.equals(field.getName())) {
                    return field;
                }
            }
            entityClass = entityClass.getSuperclass();
        }
        return null;
    }
1018115
public static Field getFieldFromClass(String field, Class<? extends Object> clazz) {
        try {
            return clazz.getDeclaredField(field);
        } catch (Exception e) {
            try {
                return clazz.getField(field);
            } catch (Exception ex) {
            }
        }
        return null;
    }