mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-16 04:45:49 +00:00
Updating using GitHub API 2025-06-19-15:31
This commit is contained in:
parent
28225fed73
commit
df938fa402
1 changed files with 3 additions and 5 deletions
|
@ -134,10 +134,8 @@ public class Owner extends Person {
|
|||
public Pet getPet(String name, boolean ignoreNew) {
|
||||
for (Pet pet : getPets()) {
|
||||
String compName = pet.getName();
|
||||
if (compName != null && compName.equalsIgnoreCase(name)) {
|
||||
if (!ignoreNew || !pet.isNew()) {
|
||||
return pet;
|
||||
}
|
||||
if (compName != null && compName.equalsIgnoreCase(name) && (!ignoreNew || !pet.isNew())) {
|
||||
return pet;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -172,4 +170,4 @@ public class Owner extends Person {
|
|||
pet.addVisit(visit);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue