applying spring -javaformant

This commit is contained in:
bijomutta 2023-07-13 05:18:07 +02:00
parent f3e3a5eea8
commit ad32bd832c

View file

@ -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");
}