Buggy code:
@ Service @ Transactional public class ConfigurationServiceImpl implements ConfigurationService { private static final Logger LOG = LoggerFactory . getLogger ( ConfigurationServiceImpl . class ) ; private static final String DEFAULT_STRUCT_DESC = "Generated" ; @ Autowired private ConfigurationDao < Configuration > configurationDao ; @ Autowired private EndpointGroupDao < EndpointGroup > endpointGroupDao ; @ Autowired private ConfigurationSchemaDao < ConfigurationSchema > configurationSchemaDao ; @ Autowired private HistoryService historyService ; @ Autowired private SchemaGenerationAlgorithmFactory schemaGeneratorFactory ; private DefaultRecordGenerationAlgorithm < BaseData > configurationProcessor ; private UuidValidator uuidValidator ; @ Override @ Deprecated public ConfigurationDto findConfigurationByAppIdAndVersion ( String applicationId , int version ) { } @ Override public ConfigurationDto findConfigurationByEndpointGroupIdAndVersion ( String endpointGroupId , int version ) { } @ Override public ConfigurationDto findDefaultConfigurationBySchemaId ( String schemaId ) { } @ Override public ConfigurationDto findConfigurationById ( String id ) { } @ Override public Collection < StructureRecordDto < ConfigurationDto > > findAllConfigurationRecordsByEndpointGroupId ( String endpointGroupId , boolean includeDeprecated ) { } @ Override public StructureRecordDto < ConfigurationDto > findConfigurationRecordBySchemaIdAndEndpointGroupId ( String schemaId , String endpointGroupId ) { } @ Override public List < SchemaDto > findVacantSchemasByEndpointGroupId ( String endpointGroupId ) { } @ Override public ConfigurationDto saveConfiguration ( ConfigurationDto configurationDto ) { validateConfiguration ( configurationDto ) ; String id = configurationDto . getId ( ) ; ConfigurationSchemaDto configurationSchemaDto ; Configuration oldActiveConfiguration = null ; if ( StringUtils . isNotBlank ( id ) ) { ConfigurationDto oldConfiguration = findConfigurationById ( configurationDto . getId ( ) ) ; if ( ( oldConfiguration != null ) && ( ( oldConfiguration . getStatus ( ) ) != ( INACTIVE ) ) ) { throw new UpdateStatusConflictException ( ( "Can't<seq2seq4repair_space>update<seq2seq4repair_space>configuration,<seq2seq4repair_space>invalid<seq2seq4repair_space>id<seq2seq4repair_space>" + id ) ) ; } configurationSchemaDto = findConfSchemaById ( configurationDto . getSchemaId ( ) ) ; ConfigurationServiceImpl . LOG . debug ( "Update<seq2seq4repair_space>existing<seq2seq4repair_space>configuration<seq2seq4repair_space>with<seq2seq4repair_space>id:<seq2seq4repair_space>[{}]" , configurationDto . getId ( ) ) ; } else { String schemaId = configurationDto . getSchemaId ( ) ; String groupId = configurationDto . getEndpointGroupId ( ) ; configurationSchemaDto = findConfSchemaById ( schemaId ) ; if ( configurationSchemaDto != null ) { Configuration oldInactiveConfiguration = configurationDao . findInactiveBySchemaIdAndGroupId ( schemaId , groupId ) ; oldActiveConfiguration = configurationDao . findLatestActiveBySchemaIdAndGroupId ( schemaId , groupId ) ; if ( oldInactiveConfiguration != null ) { configurationDto . setId ( idToString ( oldInactiveConfiguration . getId ( ) ) ) ; configurationDto . setSequenceNumber ( oldInactiveConfiguration . getSequenceNumber ( ) ) ; } else if ( oldActiveConfiguration != null ) { configurationDto . setSequenceNumber ( oldActiveConfiguration . getSequenceNumber ( ) ) ; } configurationDto . setApplicationId ( configurationSchemaDto . getApplicationId ( ) ) ; configurationDto . setMajorVersion ( configurationSchemaDto . getMajorVersion ( ) ) ; configurationDto . setMinorVersion ( configurationSchemaDto . getMinorVersion ( ) ) ; configurationDto . setProtocolSchema ( configurationSchemaDto . getProtocolSchema ( ) ) ; configurationDto . setCreatedTime ( System . currentTimeMillis ( ) ) ; } else { ConfigurationServiceImpl . LOG . debug ( "Can't<seq2seq4repair_space>find<seq2seq4repair_space>related<seq2seq4repair_space>Configuration<seq2seq4repair_space>schema." ) ; throw new IncorrectParameterException ( ( "Configuration<seq2seq4repair_space>schema<seq2seq4repair_space>not<seq2seq4repair_space>found,<seq2seq4repair_space>id:" + schemaId ) ) ; } } ConfigurationDto oldActiveConfigurationDto = ( oldActiveConfiguration != null ) ? oldActiveConfiguration . toDto ( ) : null ; validateUuids ( configurationDto , oldActiveConfigurationDto , configurationSchemaDto ) ; configurationDto . setStatus ( INACTIVE ) ; configurationDto . setLastModifyTime ( System . currentTimeMillis ( ) ) ; <START_BUG> return getDto ( configurationDao . save ( new Configuration ( configurationDto ) ) ) ; <END_BUG> } private void validateUuids ( ConfigurationDto currentConfiguration , ConfigurationDto previousConfiguration , ConfigurationSchemaDto configurationSchema ) { } @ Override public ChangeConfigurationNotification activateConfiguration ( String id , String activatedUsername ) { } @ Override public ChangeConfigurationNotification deactivateConfiguration ( String id , String deactivatedUsername ) { } @ Override public ChangeConfigurationNotification deleteConfigurationRecord ( String schemaId , String groupId , String deactivatedUsername ) { } @ Override public List < ConfigurationDto > findConfigurationsByEndpointGroupId ( String endpointGroupId ) { } @ Override public List < ConfigurationSchemaDto > findConfSchemasByAppId ( String applicationId ) { } @ Override public List < SchemaDto > findConfigurationSchemaVersionsByAppId ( String applicationId ) { } @ Override public ConfigurationSchemaDto findConfSchemaByAppIdAndVersion ( String applicationId , int version ) { } @ Override public ConfigurationSchemaDto saveConfSchema ( ConfigurationSchemaDto schemaDto , String groupId ) { } @ Override public ConfigurationSchemaDto saveConfSchema ( ConfigurationSchemaDto configurationSchema ) { } @ Override public ConfigurationSchemaDto findConfSchemaById ( String id ) { } @ Override public void removeConfSchemasByAppId ( String appId ) { } private ChangeNotificationDto createNotification ( ConfigurationDto configurationDto , HistoryDto historyDto ) { } private void generateSchemas ( ConfigurationSchemaDto schema ) throws SchemaCreationException { } private void removeCascadeConfigurationSchema ( String id ) { } private HistoryDto addHistory ( ConfigurationDto dto , ChangeType type ) { } private void validateConfiguration ( ConfigurationDto dto ) { } private ConfigurationSchemaDto saveConfigurationSchema ( ConfigurationSchemaDto configurationSchema ) { } private ConfigurationSchemaDto findLatestConfSchemaByAppId ( String applicationId ) { } }

Fix:
return getDto ( configurationDao . save ( new Configuration ( configurationDto ) , Configuration . class ) ) ;