Add NullAway and JSpecify annotations

See gh-2016

Signed-off-by: Moritz Halbritter <moritz.halbritter@broadcom.com>
This commit is contained in:
Moritz Halbritter 2025-09-02 13:12:56 +02:00 committed by Stéphane Nicoll
parent 3aa79e3944
commit a0aea8e8f8
26 changed files with 171 additions and 59 deletions

View file

@ -82,7 +82,7 @@ class ClinicServiceTests {
@Autowired
protected VetRepository vets;
Pageable pageable;
private final Pageable pageable = Pageable.unpaged();
@Test
void shouldFindOwnersByLastName() {

View file

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