diff --git a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java index 96e8b41a60b..848d4f08e2f 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java @@ -137,7 +137,7 @@ public String initUpdateOwnerForm(@PathVariable("ownerId") int ownerId, Model mo @PostMapping("/owners/{ownerId}/edit") public String processUpdateOwnerForm(@Valid Owner owner, BindingResult result, @PathVariable("ownerId") int ownerId, - RedirectAttributes redirectAttributes) { + RedirectAttributes redirectAttributes) { if (result.hasErrors()) { redirectAttributes.addFlashAttribute("error", "There was an error in updating the owner."); return VIEWS_OWNER_CREATE_OR_UPDATE_FORM; diff --git a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java index bd61fcd9786..781fb5805ca 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/PetController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/PetController.java @@ -99,7 +99,8 @@ public String initCreationForm(Owner owner, ModelMap model) { } @PostMapping("/pets/new") - public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult result, ModelMap model, RedirectAttributes redirectAttributes) { + public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult result, ModelMap model, + RedirectAttributes redirectAttributes) { if (StringUtils.hasText(pet.getName()) && pet.isNew() && owner.getPet(pet.getName(), true) != null) { result.rejectValue("name", "duplicate", "already exists"); } @@ -121,14 +122,16 @@ public String processCreationForm(Owner owner, @Valid Pet pet, BindingResult res } @GetMapping("/pets/{petId}/edit") - public String initUpdateForm(Owner owner, @PathVariable("petId") int petId, ModelMap model,RedirectAttributes redirectAttributes) { + public String initUpdateForm(Owner owner, @PathVariable("petId") int petId, ModelMap model, + RedirectAttributes redirectAttributes) { Pet pet = owner.getPet(petId); model.put("pet", pet); return VIEWS_PETS_CREATE_OR_UPDATE_FORM; } @PostMapping("/pets/{petId}/edit") - public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model,RedirectAttributes redirectAttributes) { + public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model, + RedirectAttributes redirectAttributes) { String petName = pet.getName(); diff --git a/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java b/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java index 6b5278367e9..fde7493a050 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/VisitController.java @@ -82,7 +82,7 @@ public String initNewVisitForm() { // called @PostMapping("/owners/{ownerId}/pets/{petId}/visits/new") public String processNewVisitForm(@ModelAttribute Owner owner, @PathVariable int petId, @Valid Visit visit, - BindingResult result, RedirectAttributes redirectAttributes) { + BindingResult result, RedirectAttributes redirectAttributes) { if (result.hasErrors()) { return "pets/createOrUpdateVisitForm"; }