* @param clazz The class for which to retrieve the fields.
*
* @return Returns the fields for this class.
*/
public static Field[] getDeclaredFields(Class<?> clazz) {
GetDeclaredFields action = GetDeclaredFields.action( clazz );
final Field[] fields;
if ( System.getSecurityManager() != null ) {
fields = AccessController.doPrivileged( action );
}
else {
fields = action.run();
}
return fields;
}