}
}
private void assertPayloadParameterExists(Annotation annotation) {
try {
final GetMethod getMethod = GetMethod.action( annotation.annotationType(), "payload" );
final Method method;
if ( System.getSecurityManager() != null ) {
method = AccessController.doPrivileged( getMethod );
}
else {
method = getMethod.run();
}
if (method == null) {
String msg = annotation.annotationType().getName() + " contains Constraint annotation, but does " +
"not contain a payload parameter.";
throw new ConstraintDefinitionException( msg );