mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-24 00:35:49 +00:00
applying spring -javaformant
This commit is contained in:
parent
f3e3a5eea8
commit
ad32bd832c
1 changed files with 1 additions and 2 deletions
|
@ -116,10 +116,9 @@ class PetController {
|
|||
|
||||
String petName = pet.getName();
|
||||
|
||||
//checking if the pet name already exist for the owner
|
||||
// checking if the pet name already exist for the owner
|
||||
if (StringUtils.hasLength(petName)) {
|
||||
Pet existingPet = owner.getPet(petName.toLowerCase(), false);
|
||||
//adding error if pet name already exist
|
||||
if (existingPet != null && existingPet.getId() != pet.getId()) {
|
||||
result.rejectValue("name", "duplicate", "already exists");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue