| In case of simple custom string message defined by the user we should not cache it and just return an unescaped version of it. An example of such message:
public class Person {
@NotNull(message = "name should not be `null`")
String name;
}
Benchmarks for such a change:
6.0.8:
Benchmark Mode Cnt Score Error Units
SimpleValidation.testSimpleBeanValidation thrpt 20 1020.530 ± 29.516 ops/ms
SimpleValidation.testSimpleBeanValidationCustomMessage thrpt 20 1140.450 ± 111.788 ops/ms
changes:
Benchmark Mode Cnt Score Error Units
SimpleValidation.testSimpleBeanValidation thrpt 20 1087.163 ± 30.949 ops/ms
SimpleValidation.testSimpleBeanValidationCustomMessage thrpt 20 1339.740 ± 26.829 ops/ms
|