// These modifiers are allowed
final int validModifiers = Modifier.PUBLIC | Modifier.PROTECTED | allowedModifiers;
int invalidModifiers = method.getModifiers() & ~validModifiers;
if (invalidModifiers > 0) {
throw new ApplicationRuntimeException(AnnotationsMessages.annotatedMethodHasInvalidModifiers(method, methodType, invalidModifiers));
}
// TODO: Check for package access
// Check for setAccessible-Errors when Modifier.PROTECTED is used
if (Modifier.isProtected(method.getModifiers())) {
// Try to set method accessible
try
{
method.setAccessible(true);
}
catch (SecurityException e)
{
throw new ApplicationRuntimeException(AnnotationsMessages.annotatedMethodIsProtectedAndNotAccessible(method, methodType));
}
}
}