code: 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;
  	}
docs: Find a field in a class (and its ancestors) with a given name.
  
  @param type
  the class
  @param name
  the name
  @return the field. <code>null</code> if not found.