Skip to content
Snippets Groups Projects
Commit 735fb114 authored by Antoine Rey's avatar Antoine Rey
Browse files

Remove explicit unboxing

parent dc0fb9ab
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ public class JdbcPetRepositoryImpl implements PetRepository { ...@@ -91,7 +91,7 @@ public class JdbcPetRepositoryImpl implements PetRepository {
params, params,
new JdbcPetRowMapper()); new JdbcPetRowMapper());
} catch (EmptyResultDataAccessException ex) { } catch (EmptyResultDataAccessException ex) {
throw new ObjectRetrievalFailureException(Pet.class, new Integer(id)); throw new ObjectRetrievalFailureException(Pet.class, id);
} }
Owner owner = this.ownerRepository.findById(pet.getOwnerId()); Owner owner = this.ownerRepository.findById(pet.getOwnerId());
owner.addPet(pet); owner.addPet(pet);
......
...@@ -78,10 +78,10 @@ public class JdbcVetRepositoryImpl implements VetRepository { ...@@ -78,10 +78,10 @@ public class JdbcVetRepositoryImpl implements VetRepository {
new BeanPropertyRowMapper<Integer>() { new BeanPropertyRowMapper<Integer>() {
@Override @Override
public Integer mapRow(ResultSet rs, int row) throws SQLException { public Integer mapRow(ResultSet rs, int row) throws SQLException {
return Integer.valueOf(rs.getInt(1)); return rs.getInt(1);
} }
}, },
vet.getId().intValue()); vet.getId());
for (int specialtyId : vetSpecialtiesIds) { for (int specialtyId : vetSpecialtiesIds) {
Specialty specialty = EntityUtils.getById(specialties, Specialty.class, specialtyId); Specialty specialty = EntityUtils.getById(specialties, Specialty.class, specialtyId);
vet.addSpecialty(specialty); vet.addSpecialty(specialty);
......
...@@ -45,7 +45,7 @@ public abstract class EntityUtils { ...@@ -45,7 +45,7 @@ public abstract class EntityUtils {
public static <T extends BaseEntity> T getById(Collection<T> entities, Class<T> entityClass, int entityId) public static <T extends BaseEntity> T getById(Collection<T> entities, Class<T> entityClass, int entityId)
throws ObjectRetrievalFailureException { throws ObjectRetrievalFailureException {
for (T entity : entities) { for (T entity : entities) {
if (entity.getId().intValue() == entityId && entityClass.isInstance(entity)) { if (entity.getId() == entityId && entityClass.isInstance(entity)) {
return entity; return entity;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment