mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2026-02-06 14:21:11 +00:00
Add NullAway and JSpecify annotations
See gh-2016 Signed-off-by: Moritz Halbritter <moritz.halbritter@broadcom.com>
This commit is contained in:
parent
3aa79e3944
commit
a0aea8e8f8
26 changed files with 171 additions and 59 deletions
|
|
@ -82,7 +82,7 @@ class ClinicServiceTests {
|
|||
@Autowired
|
||||
protected VetRepository vets;
|
||||
|
||||
Pageable pageable;
|
||||
private final Pageable pageable = Pageable.unpaged();
|
||||
|
||||
@Test
|
||||
void shouldFindOwnersByLastName() {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public abstract class EntityUtils {
|
|||
public static <T extends BaseEntity> T getById(Collection<T> entities, Class<T> entityClass, int entityId)
|
||||
throws ObjectRetrievalFailureException {
|
||||
for (T entity : entities) {
|
||||
if (entity.getId() == entityId && entityClass.isInstance(entity)) {
|
||||
if (entity.getId() != null && entity.getId() == entityId && entityClass.isInstance(entity)) {
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue