import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.HibernateValidator;
import org.hibernate.validator.method.MethodValidator;
public class HibernateBug {
public static String sayHi(@NotNull String name) {
return "Hello " + name;
}
public static void main(String[] args) throws Exception {
Validator validator = Validation.byProvider(HibernateValidator.class)
.configure()
.buildValidatorFactory()
.getValidator();
MethodValidator mv = validator.unwrap(MethodValidator.class);
mv.validateAllParameters(null, HibernateBug.class.getMethod("sayHi", String.class), new Object[] { null });
}
}