Revize 66e2b6d7
Přidáno uživatelem stepanekp před více než 1 rok
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/service/managment/PersonServiceImpl.java | ||
---|---|---|
17 | 17 |
@Transactional |
18 | 18 |
public class PersonServiceImpl implements PersonService { |
19 | 19 |
|
20 |
private final int MAX_INPUT_LENGTH = 50; |
|
21 |
|
|
20 | 22 |
@Autowired |
21 | 23 |
private PersonRepository personRepository; |
22 | 24 |
|
... | ... | |
67 | 69 |
newPerson = getPersonById(personToMergeIn.getId()); |
68 | 70 |
} |
69 | 71 |
else if (personToMergeIn == null) { |
70 |
if (newName.length() > 50)
|
|
71 |
newName = newName.substring(0, 50);
|
|
72 |
if (newName.length() > MAX_INPUT_LENGTH)
|
|
73 |
newName = newName.substring(0, MAX_INPUT_LENGTH);
|
|
72 | 74 |
|
73 | 75 |
newPerson = new Person(newName, project); |
74 | 76 |
newPerson = savePerson(newPerson); |
Také k dispozici: Unified diff
https://kivprogrammers.atlassian.net/browse/TSP2-48 Délka vstupu jako konstanta