Buggy code:
@ Service public class GalvanizeServiceImpl implements GalvanizeService { private static final Logger log = Logger . getLogger ( GalvanizeService . class ) ; @ Autowired private ContactManager contactManager ; @ Autowired private DateEventManager dateEventManager ; @ Autowired private DateEventTypeManager dateEventTypeManager ; @ Autowired private ImageManager imageManager ; @ Autowired private TransformServiceImpl transformService ; @ Autowired private RelationshipManager relationshipManager ; @ Autowired private MinistryManager ministryManager ; @ Autowired private EventManager eventManager ; @ Autowired private UserManager userManager ; @ Autowired private UserRoleManager userRoleManager ; @ Autowired private EmailProviderManager emailProviderManager ; @ Transactional public Image findImage ( Long id ) { } @ Transactional public List < ContactForm > findDateEventAttendance ( Long dateEventId ) { } @ Transactional public DateEventForm findDateEvent ( Long dateEventId ) { } @ Transactional public DateEventTypeForm findDateEventType ( Long dateEventTypeId ) { } @ Transactional public List < ContactForm > findContactsFromMinistry ( Long ministryId ) { } @ Transactional public DateEventAttendanceForm findDateEventAttendanceCriteria ( DateEventAttendanceForm dateEventAttendanceForm ) { } @ Transactional public ContactForm save ( ContactForm contactForm ) { } public void saveUpload ( Long id , byte [ ] bytes ) { } @ Transactional public void delete ( ContactForm contactForm ) { } @ Transactional public void delete ( RelationshipForm relationshipForm ) { } @ Transactional public DateEventForm save ( DateEventForm dateEventForm ) { } @ Transactional public DateEventTypeForm save ( DateEventTypeForm dateEventTypeForm ) { } @ Transactional public void delete ( DateEventForm dateEventForm ) { } @ Transactional public void delete ( DateEventTypeForm dateEventTypeForm ) { } @ Transactional public ContactForm find ( ContactForm contactForm ) { } @ Transactional public DateEventTypeForm find ( DateEventTypeForm dateEventTypeForm ) { } @ Transactional public List < ContactForm > findAllContacts ( ) { } @ Transactional public List < Image > findAllImages ( ) { } @ Transactional public void save ( Image image ) { } @ Transactional public List < ContactForm > findContactList ( ) { } @ Transactional public List < ContactForm > searchContacts ( String searchQuery ) { } @ Transactional public List < BasicContactForm > findContactDropDown ( ) { } @ Transactional public List < ContactForm > findRecentContactDropDown ( ) { } @ Transactional public Map < String , String > findAllRelationTypes ( ) { } @ Transactional public Map < String , String > findAllDateEventTypes ( ) { } @ Transactional public List < DateEventForm > findAllDateEvents ( ) { } @ Transactional public void deleteDateEventAttendance ( Long contactId , Long dateEventId , String userId ) { } @ Transactional public void addContactToMinistry ( Long ministryId , Long contactId , String userId ) { } @ Transactional public void removeContactFromMinistry ( Long ministryId , Long contactId , String userId ) { } @ Transactional public List < DateEventForm > findDateEventsByType ( Long dateEventTypeId ) { } @ Transactional public void save ( DateEventAttendanceForm dateEventAttendanceForm ) { } @ Transactional public List < MinistryForm > findAllMinistries ( ) { } @ Transactional public MinistryForm find ( MinistryForm ministryForm ) { } @ Transactional public MinistryForm save ( MinistryForm ministryForm ) { } @ Transactional public void delete ( MinistryForm ministryForm ) { } @ Transactional public List < EventForm > findAllEvents ( ) { } @ Transactional public EventForm find ( EventForm eventForm ) { } @ Transactional public List < ContactForm > findContactsFromEvent ( Long eventId ) { } @ Transactional public void addContactToEvent ( Long eventId , Long contactId , String userId ) { } @ Transactional public void removeContactFromEvent ( Long eventId , Long contactId , String userId ) { } @ Transactional public EventForm save ( EventForm eventForm ) { } @ Transactional public void delete ( EventForm eventForm ) { } @ Transactional public List < UserForm > findUsers ( ) { } @ Transactional public UserForm findUser ( Long id ) { } @ Transactional public UserForm findUser ( String name ) { } @ Transactional public UserForm save ( UserForm userForm ) { try { User user = transformService . setForm ( userForm ) ; if ( ( user != null ) && ( ( user . getRoles ( ) ) != null ) ) { for ( UserRole role : user . getRoles ( ) ) { userRoleManager . delete ( role . getId ( ) ) ; } user . setRoles ( new ArrayList < UserRole > ( ) ) ; } user = userManager . save ( user ) ; List < String > roles = userForm . getRoles ( ) ; if ( roles != null ) { user . setRoles ( new ArrayList < UserRole > ( roles . size ( ) ) ) ; for ( String role : roles ) { UserRole userRole = new UserRole ( ) ; userRole . setAuthority ( role ) ; userRole . setUpdatedBy ( userForm . getUpdatedBy ( ) ) ; userRole . setCreatedBy ( userForm . getUpdatedBy ( ) ) ; userRole . setCreatedAt ( new Date ( ) ) ; userRole . setUpdatedAt ( new Date ( ) ) ; userRole . setUser ( user ) ; user . getRoles ( ) . add ( userRole ) ; } } <START_BUG> user = userManager . save ( user ) ; <END_BUG> return transformService . getForm ( user ) ; } catch ( Exception exc ) { throw new DatabaseException ( exc ) ; } } @ Transactional public void delete ( UserForm userForm ) { } public UserForm getCurrentUser ( ) { } public void mail ( EmailForm emailForm , List < ContactForm > contacts ) { } public Map < String , String > findAllEmailProviders ( ) { } }

Fix:
userManager . save ( user ) ;