boolean requiresAuthentication = false;
try
{
RequiresAuthentication annotation = runtimeClass.getAnnotation(RequiresAuthentication.class);
requiresAuthentication = (annotation != null);
}
catch (NullPointerException e)
{
requiresAuthentication = false;
}
if (requiresAuthentication && !ApplicationSecurity.isAuthenticated())
{
final String message = String.format("Authentication failed for %s on %s", userName, viewName);
logger.warn(message);
throw new AuthenticationException(message);
}
try
{
RequiresAuthentication annotation = method.getAnnotation(RequiresAuthentication.class);
requiresAuthentication = (annotation != null);
}
catch (NullPointerException e)
{
requiresAuthentication = false;