Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hardikSinghBehl committed Jun 21, 2024
1 parent 9e5fec8 commit 28813e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

String message() default "Stereotype violation detected! IDE and language not vibing.";

Class<?>[] groups() default { };
Class<?>[] groups() default {};

Class<? extends Payload>[] payload() default { };
Class<? extends Payload>[] payload() default {};

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ErrorHandlingControllerAdvice {

@ExceptionHandler(ConstraintViolationException.class)
ProblemDetail handle(ConstraintViolationException exception) {
List < Violation > violations = new ArrayList < > ();
List<Violation> violations = new ArrayList<>();
for (ConstraintViolation<?> violation: exception.getConstraintViolations()) {
violations.add(new Violation(violation.getPropertyPath().toString(), violation.getMessage()));
}
Expand All @@ -32,7 +32,7 @@ ProblemDetail handle(ConstraintViolationException exception) {

@ExceptionHandler(MethodArgumentNotValidException.class)
ProblemDetail handle(MethodArgumentNotValidException exception) {
List < Violation > violations = new ArrayList < > ();
List<Violation> violations = new ArrayList<>();
for (FieldError fieldError: exception.getBindingResult().getFieldErrors()) {
violations.add(new Violation(fieldError.getField(), fieldError.getDefaultMessage()));
}
Expand Down

0 comments on commit 28813e8

Please sign in to comment.