Skip to content

Commit

Permalink
modify constructor paramenter valid not null
Browse files Browse the repository at this point in the history
  • Loading branch information
birariro committed Feb 8, 2024
1 parent fd2995a commit 92c01ac
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ public class ValidationErrors extends AbstractPropertyBindingResult {
*/
public ValidationErrors(Object source, PersistentEntities entities) {

super(source.getClass().getSimpleName());

Assert.notNull(source, "Entity must not be null");
super(requireNotNull(source, "Entity must not be null").getClass().getSimpleName());
Assert.notNull(entities, "PersistentEntities must not be null");

this.entities = entities;
Expand Down Expand Up @@ -104,6 +102,10 @@ private Object lookupValueOn(Object value, String segment) {
}
};
}
private static <T> T requireNotNull(T object, String message) {
Assert.notNull(object, message);
return object;
}

@Override
public Object getTarget() {
Expand Down

0 comments on commit 92c01ac

Please sign in to comment.