nus-yam/ex-repair huggingface dataset:
Program: 61284
Project: 61284
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTO read(@PathVariable("String_Node_Str") Long userId) throws NotFoundException {
  SyncopeUser user=syncopeUserDAO.find(userId);
  if (user == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  return userDataBinder.getUserTO(user);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTO read(@PathVariable("String_Node_Str") Long userId) throws NotFoundException {
  SyncopeUser user=syncopeUserDAO.find(userId);
  if (user == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  return userDataBinder.getUserTO(user,userWorkflow);
}
Program: 61285
Project: 61285
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO update(@RequestBody UserMod userMod,@RequestParam(value="String_Node_Str",required=false) Set<Long> syncRoles,@RequestParam(value="String_Node_Str",required=false) Set<String> syncResources) throws NotFoundException, PropagationException, WorkflowException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + userMod);
  }
  SyncopeUser syncopeUser=syncopeUserDAO.find(userMod.getId());
  if (syncopeUser == null) {
    log.error("String_Node_Str" + userMod.getId() + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userMod.getId()));
  }
  syncopeUser=doExecuteAction(Constants.ACTION_UPDATE,userDataBinder.getUserTO(syncopeUser),null);
  ResourceOperations resourceOperations=userDataBinder.updateSyncopeUser(syncopeUser,userMod);
  syncopeUser=syncopeUserDAO.save(syncopeUser);
  Set<String> syncResourceNames=getSyncResourceNames(syncopeUser,syncRoles,syncResources);
  if (log.isDebugEnabled() && !syncResourceNames.isEmpty()) {
    log.debug("String_Node_Str" + syncResourceNames);
  }
  Set<String> propagatedResources=propagationManager.update(syncopeUser,resourceOperations,syncResourceNames);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + propagatedResources);
  }
  return userDataBinder.getUserTO(syncopeUser);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO update(@RequestBody UserMod userMod,@RequestParam(value="String_Node_Str",required=false) Set<Long> syncRoles,@RequestParam(value="String_Node_Str",required=false) Set<String> syncResources) throws NotFoundException, PropagationException, WorkflowException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + userMod);
  }
  SyncopeUser syncopeUser=syncopeUserDAO.find(userMod.getId());
  if (syncopeUser == null) {
    log.error("String_Node_Str" + userMod.getId() + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userMod.getId()));
  }
  syncopeUser=doExecuteAction(Constants.ACTION_UPDATE,userDataBinder.getUserTO(syncopeUser,userWorkflow),null);
  ResourceOperations resourceOperations=userDataBinder.updateSyncopeUser(syncopeUser,userMod);
  syncopeUser=syncopeUserDAO.save(syncopeUser);
  Set<String> syncResourceNames=getSyncResourceNames(syncopeUser,syncRoles,syncResources);
  if (log.isDebugEnabled() && !syncResourceNames.isEmpty()) {
    log.debug("String_Node_Str" + syncResourceNames);
  }
  Set<String> propagatedResources=propagationManager.update(syncopeUser,resourceOperations,syncResourceNames);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + propagatedResources);
  }
  return userDataBinder.getUserTO(syncopeUser,userWorkflow);
}
Program: 61286
Project: 61286
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTOs list(){
  List<SyncopeUser> users=syncopeUserDAO.findAll();
  List<UserTO> userTOs=new ArrayList<UserTO>(users.size());
  for (  SyncopeUser user : users) {
    userTOs.add(userDataBinder.getUserTO(user));
  }
  UserTOs result=new UserTOs();
  result.setUsers(userTOs);
  return result;
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTOs list(){
  List<SyncopeUser> users=syncopeUserDAO.findAll();
  List<UserTO> userTOs=new ArrayList<UserTO>(users.size());
  for (  SyncopeUser user : users) {
    userTOs.add(userDataBinder.getUserTO(user,userWorkflow));
  }
  UserTOs result=new UserTOs();
  result.setUsers(userTOs);
  return result;
}
Program: 61287
Project: 61287
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTOs search(@RequestBody NodeSearchCondition searchCondition) throws InvalidSearchConditionException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + searchCondition);
  }
  if (!searchCondition.checkValidity()) {
    log.error("String_Node_Str" + searchCondition);
    throw new InvalidSearchConditionException();
  }
  List<SyncopeUser> matchingUsers=syncopeUserDAO.search(searchCondition);
  UserTOs result=new UserTOs();
  for (  SyncopeUser user : matchingUsers) {
    result.addUser(userDataBinder.getUserTO(user));
  }
  return result;
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTOs search(@RequestBody NodeSearchCondition searchCondition) throws InvalidSearchConditionException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + searchCondition);
  }
  if (!searchCondition.checkValidity()) {
    log.error("String_Node_Str" + searchCondition);
    throw new InvalidSearchConditionException();
  }
  List<SyncopeUser> matchingUsers=syncopeUserDAO.search(searchCondition);
  UserTOs result=new UserTOs();
  for (  SyncopeUser user : matchingUsers) {
    result.addUser(userDataBinder.getUserTO(user,userWorkflow));
  }
  return result;
}
Program: 61288
Project: 61288
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTO generateToken(@PathVariable("String_Node_Str") Long userId) throws WorkflowException, NotFoundException {
  UserTO userTO=new UserTO();
  userTO.setId(userId);
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_GENERATE_TOKEN,userTO,null));
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTO generateToken(@PathVariable("String_Node_Str") Long userId) throws WorkflowException, NotFoundException {
  UserTO userTO=new UserTO();
  userTO.setId(userId);
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_GENERATE_TOKEN,userTO,null),userWorkflow);
}
Program: 61289
Project: 61289
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO activate(@RequestBody UserTO userTO) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_ACTIVATE,userTO,Collections.singletonMap(Constants.TOKEN,(Object)userTO.getToken())));
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO activate(@RequestBody UserTO userTO) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_ACTIVATE,userTO,Collections.singletonMap(Constants.TOKEN,(Object)userTO.getToken())),userWorkflow);
}
Program: 61291
Project: 61291
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO executeAction(HttpServletResponse response,@RequestBody UserTO userTO,@PathVariable(value="String_Node_Str") String actionName) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(actionName,userTO,null));
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO executeAction(HttpServletResponse response,@RequestBody UserTO userTO,@PathVariable(value="String_Node_Str") String actionName) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(actionName,userTO,null),userWorkflow);
}
Program: 61292
Project: 61292
Buggy source:
public UserTO getUserTO(SyncopeUser user){
  UserTO userTO=new UserTO();
  userTO.setId(user.getId());
  userTO.setCreationTime(user.getCreationTime());
  userTO.setToken(user.getToken());
  userTO.setTokenExpireTime(user.getTokenExpireTime());
  userTO.setPassword(user.getPassword());
  userTO=(UserTO)fillTO(userTO,user.getAttributes(),user.getDerivedAttributes(),user.getResources());
  MembershipTO membershipTO=new MembershipTO();
  for (  Membership membership : user.getMemberships()) {
    membershipTO.setId(membership.getId());
    membershipTO.setRole(membership.getSyncopeRole().getId());
    membershipTO=(MembershipTO)fillTO(membershipTO,membership.getAttributes(),membership.getDerivedAttributes(),membership.getResources());
    userTO.addMembership(membershipTO);
  }
  return userTO;
}

Fixed version (ground truth):
public UserTO getUserTO(SyncopeUser user,Workflow userWorkflow){
  UserTO userTO=new UserTO();
  userTO.setId(user.getId());
  userTO.setCreationTime(user.getCreationTime());
  userTO.setToken(user.getToken());
  userTO.setTokenExpireTime(user.getTokenExpireTime());
  userTO.setPassword(user.getPassword());
  String status=null;
  try {
    List<Step> currentSteps=userWorkflow.getCurrentSteps(user.getWorkflowEntryId());
    if (currentSteps != null && !currentSteps.isEmpty()) {
      status=currentSteps.iterator().next().getStatus();
    }
 else {
      log.error("String_Node_Str" + user);
    }
  }
 catch (  EntityNotFoundException e) {
    log.error("String_Node_Str" + user.getWorkflowEntryId());
  }
  userTO.setStatus(status);
  userTO=(UserTO)fillTO(userTO,user.getAttributes(),user.getDerivedAttributes(),user.getResources());
  MembershipTO membershipTO=new MembershipTO();
  for (  Membership membership : user.getMemberships()) {
    membershipTO.setId(membership.getId());
    membershipTO.setRole(membership.getSyncopeRole().getId());
    membershipTO=(MembershipTO)fillTO(membershipTO,membership.getAttributes(),membership.getDerivedAttributes(),membership.getResources());
    userTO.addMembership(membershipTO);
  }
  return userTO;
}
Program: 61295
Project: 61295
Buggy source:
@Override @Transactional public void execute(Map transientVars,Map args,PropertySet ps) throws WorkflowException {
  SyncopeUser syncopeUser=(SyncopeUser)transientVars.get(Constants.SYNCOPE_USER);
  AttributeDAO attributeDAO=(AttributeDAO)context.getBean("String_Node_Str");
  for (  AbstractAttribute attribute : syncopeUser.getAttributes()) {
    attributeDAO.delete(attribute.getId(),UserAttribute.class);
  }
  syncopeUser.getAttributes().clear();
  DerivedAttributeDAO derivedAttributeDAO=(DerivedAttributeDAO)context.getBean("String_Node_Str");
  for (  AbstractDerivedAttribute derivedAttribute : syncopeUser.getDerivedAttributes()) {
    derivedAttributeDAO.delete(derivedAttribute.getId(),UserDerivedAttribute.class);
  }
  syncopeUser.getDerivedAttributes().clear();
  MembershipDAO membershipDAO=(MembershipDAO)context.getBean("String_Node_Str");
  for (  Membership membership : syncopeUser.getMemberships()) {
    membershipDAO.delete(membership.getId());
  }
  syncopeUser.getMemberships().clear();
  syncopeUser.setCreationTime(null);
  syncopeUser.setPassword(null);
  transientVars.put(Constants.SYNCOPE_USER,syncopeUser);
}

Fixed version (ground truth):
@Override @Transactional public void execute(Map transientVars,Map args,PropertySet ps) throws WorkflowException {
  SyncopeUser syncopeUser=(SyncopeUser)transientVars.get(Constants.SYNCOPE_USER);
  AttributeDAO attributeDAO=(AttributeDAO)context.getBean("String_Node_Str");
  for (  AbstractAttribute attribute : syncopeUser.getAttributes()) {
    attributeDAO.delete(attribute.getId(),UserAttribute.class);
  }
  syncopeUser.getAttributes().clear();
  DerivedAttributeDAO derivedAttributeDAO=(DerivedAttributeDAO)context.getBean("String_Node_Str");
  for (  AbstractDerivedAttribute derivedAttribute : syncopeUser.getDerivedAttributes()) {
    derivedAttributeDAO.delete(derivedAttribute.getId(),UserDerivedAttribute.class);
  }
  syncopeUser.getDerivedAttributes().clear();
  for (  Membership membership : syncopeUser.getMemberships()) {
    for (    AbstractAttribute attribute : membership.getAttributes()) {
      attributeDAO.delete(attribute.getId(),MembershipAttribute.class);
    }
    membership.getAttributes().clear();
    for (    AbstractDerivedAttribute derivedAttribute : membership.getDerivedAttributes()) {
      derivedAttributeDAO.delete(derivedAttribute.getId(),MembershipDerivedAttribute.class);
    }
    membership.getDerivedAttributes().clear();
  }
  syncopeUser.setCreationTime(null);
  syncopeUser.setPassword(null);
  transientVars.put(Constants.SYNCOPE_USER,syncopeUser);
}
Program: 61296
Project: 61296
Buggy source:
/** 
 * TODO: password policies
 * @param password
 */
public void setPassword(String password){
  try {
    KeyPair kp=AsymmetricCipher.generateKeyPair();
    this.password=AsymmetricCipher.encrypt(password.getBytes(),kp.getPublic());
    this.passwordKeyPair=AsymmetricCipher.serializeKeyPair(kp);
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
}

Fixed version (ground truth):
/** 
 * TODO: password policies
 * @param password
 */
public void setPassword(String password){
  if (password == null) {
    this.password=null;
    this.passwordKeyPair=null;
    return;
  }
  try {
    KeyPair kp=AsymmetricCipher.generateKeyPair();
    this.password=AsymmetricCipher.encrypt(password.getBytes(),kp.getPublic());
    this.passwordKeyPair=AsymmetricCipher.serializeKeyPair(kp);
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
}
Program: 61297
Project: 61297
Buggy source:
public String getPassword(){
  String result=null;
  try {
    KeyPair kp=AsymmetricCipher.deserializeKeyPair(passwordKeyPair);
    result=new String(AsymmetricCipher.decrypt(password,kp.getPrivate()));
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
  return result;
}

Fixed version (ground truth):
public String getPassword(){
  if (password == null || passwordKeyPair == null) {
    return null;
  }
  String result=null;
  try {
    KeyPair kp=AsymmetricCipher.deserializeKeyPair(passwordKeyPair);
    result=new String(AsymmetricCipher.decrypt(password,kp.getPrivate()));
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
  return result;
}
Program: 61298
Project: 61298
Buggy source:
@Override @Transactional public <T extends AbstractDerivedSchema>void delete(String name,Class<T> reference){
  T derivedSchema=find(name,reference);
  if (derivedSchema == null) {
    return;
  }
  for (  AbstractSchema schema : derivedSchema.getSchemas()) {
    schema.removeDerivedSchema(derivedSchema);
  }
  derivedSchema.setSchemas(Collections.EMPTY_SET);
  for (  AbstractDerivedAttribute derivedAttribute : derivedSchema.getDerivedAttributes()) {
    derivedAttribute.setDerivedSchema(null);
    derivedAttributeDAO.delete(derivedAttribute.getId(),derivedAttribute.getClass());
  }
  entityManager.remove(derivedSchema);
}

Fixed version (ground truth):
@Override @Transactional public <T extends AbstractDerivedSchema>void delete(String name,Class<T> reference){
  T derivedSchema=find(name,reference);
  if (derivedSchema == null) {
    return;
  }
  for (  AbstractSchema schema : derivedSchema.getSchemas()) {
    schema.removeDerivedSchema(derivedSchema);
  }
  derivedSchema.setSchemas(Collections.EMPTY_SET);
  for (  AbstractDerivedAttribute derivedAttribute : derivedSchema.getDerivedAttributes()) {
    derivedAttribute.setDerivedSchema(null);
    derivedAttributeDAO.delete(derivedAttribute.getId(),derivedAttribute.getClass());
  }
  derivedSchema.setDerivedAttributes(Collections.EMPTY_SET);
  entityManager.remove(derivedSchema);
}
Program: 61299
Project: 61299
Buggy source:
private Integer findWorkflowAction(Long workflowEntryId,String actionName){
  WorkflowDescriptor workflowDescriptor=userWorkflow.getWorkflowDescriptor(Constants.USER_WORKFLOW);
  int[] actions=userWorkflow.getAvailableActions(workflowEntryId,null);
  Integer actionId=null;
  for (int i=0; i < actions.length && actionId == null; i++) {
    if (actionName.equals(workflowDescriptor.getAction(actions[i]).getName())) {
      actionId=actions[i];
    }
  }
  return actionId;
}

Fixed version (ground truth):
private Integer findWorkflowAction(Long workflowEntryId,String actionName){
  WorkflowDescriptor workflowDescriptor=userWorkflow.getWorkflowDescriptor(Constants.USER_WORKFLOW);
  int[] actions=userWorkflow.getAvailableActions(workflowEntryId,null);
  Integer actionId=null;
  for (int i=0; i < actions.length && actionId == null; i++) {
    if (actionName.equals(workflowDescriptor.getAction(actions[i]).getName())) {
      actionId=actions[i];
    }
  }
  Map<Integer,ActionDescriptor> commonActions=workflowDescriptor.getCommonActions();
  for (  Integer actionNumber : commonActions.keySet()) {
    if (actionName.equals(commonActions.get(actionNumber).getName())) {
      actionId=actionNumber;
    }
  }
  return actionId;
}
Program: 61300
Project: 61300
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO verifyToken(@RequestBody UserTO userTO) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_VERIFY_TOKEN,userTO,Collections.singletonMap(Constants.TOKEN,(Object)userTO.getToken())),userWorkflow);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO verifyToken(@RequestBody UserTO userTO) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_VERIFY_TOKEN,userTO.getId(),Collections.singletonMap(Constants.TOKEN,(Object)userTO.getToken())),userWorkflow);
}
Program: 61301
Project: 61301
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO update(@RequestBody UserMod userMod,@RequestParam(value="String_Node_Str",required=false) Set<Long> syncRoles,@RequestParam(value="String_Node_Str",required=false) Set<String> syncResources) throws NotFoundException, PropagationException, WorkflowException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + userMod);
  }
  SyncopeUser syncopeUser=syncopeUserDAO.find(userMod.getId());
  if (syncopeUser == null) {
    log.error("String_Node_Str" + userMod.getId() + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userMod.getId()));
  }
  syncopeUser=doExecuteAction(Constants.ACTION_UPDATE,userDataBinder.getUserTO(syncopeUser,userWorkflow),null);
  ResourceOperations resourceOperations=userDataBinder.updateSyncopeUser(syncopeUser,userMod);
  syncopeUser=syncopeUserDAO.save(syncopeUser);
  Set<String> syncResourceNames=getSyncResourceNames(syncopeUser,syncRoles,syncResources);
  if (log.isDebugEnabled() && !syncResourceNames.isEmpty()) {
    log.debug("String_Node_Str" + syncResourceNames);
  }
  Set<String> propagatedResources=propagationManager.update(syncopeUser,resourceOperations,syncResourceNames);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + propagatedResources);
  }
  return userDataBinder.getUserTO(syncopeUser,userWorkflow);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO update(@RequestBody UserMod userMod,@RequestParam(value="String_Node_Str",required=false) Set<Long> syncRoles,@RequestParam(value="String_Node_Str",required=false) Set<String> syncResources) throws NotFoundException, PropagationException, WorkflowException {
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + userMod);
  }
  SyncopeUser syncopeUser=syncopeUserDAO.find(userMod.getId());
  if (syncopeUser == null) {
    log.error("String_Node_Str" + userMod.getId() + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userMod.getId()));
  }
  syncopeUser=doExecuteAction(Constants.ACTION_UPDATE,syncopeUser.getId(),null);
  ResourceOperations resourceOperations=userDataBinder.updateSyncopeUser(syncopeUser,userMod);
  syncopeUser=syncopeUserDAO.save(syncopeUser);
  userDataBinder.checkUniqueness(syncopeUser);
  Set<String> syncResourceNames=getSyncResourceNames(syncopeUser,syncRoles,syncResources);
  if (log.isDebugEnabled() && !syncResourceNames.isEmpty()) {
    log.debug("String_Node_Str" + syncResourceNames);
  }
  Set<String> propagatedResources=propagationManager.update(syncopeUser,resourceOperations,syncResourceNames);
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + propagatedResources);
  }
  return userDataBinder.getUserTO(syncopeUser,userWorkflow);
}
Program: 61302
Project: 61302
Buggy source:
public SyncopeUser doExecuteAction(String actionName,UserTO userTO,Map<String,Object> moreInputs) throws WorkflowException, NotFoundException {
  SyncopeUser syncopeUser=syncopeUserDAO.find(userTO.getId());
  if (syncopeUser == null) {
    log.error("String_Node_Str" + userTO.getId() + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userTO.getId()));
  }
  Map<String,Object> inputs=new HashMap<String,Object>();
  if (moreInputs != null && !moreInputs.isEmpty()) {
    inputs.putAll(moreInputs);
  }
  inputs.put(Constants.SYNCOPE_USER,syncopeUser);
  Integer actionId=findWorkflowAction(syncopeUser.getWorkflowEntryId(),actionName);
  if (actionId == null) {
    throw new NotFoundException(actionName);
  }
  userWorkflow.doAction(syncopeUser.getWorkflowEntryId(),actionId,inputs);
  return syncopeUserDAO.save(syncopeUser);
}

Fixed version (ground truth):
public SyncopeUser doExecuteAction(String actionName,Long userId,Map<String,Object> moreInputs) throws WorkflowException, NotFoundException {
  SyncopeUser syncopeUser=syncopeUserDAO.find(userId);
  if (syncopeUser == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  Map<String,Object> inputs=new HashMap<String,Object>();
  if (moreInputs != null && !moreInputs.isEmpty()) {
    inputs.putAll(moreInputs);
  }
  inputs.put(Constants.SYNCOPE_USER,syncopeUser);
  Integer actionId=findWorkflowAction(syncopeUser.getWorkflowEntryId(),actionName);
  if (actionId == null) {
    throw new NotFoundException(actionName);
  }
  try {
    userWorkflow.doAction(syncopeUser.getWorkflowEntryId(),actionId,inputs);
  }
 catch (  InvalidActionException e) {
    throw new WorkflowException(e);
  }
  return syncopeUserDAO.save(syncopeUser);
}
Program: 61303
Project: 61303
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTO generateToken(@PathVariable("String_Node_Str") Long userId) throws WorkflowException, NotFoundException {
  UserTO userTO=new UserTO();
  userTO.setId(userId);
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_GENERATE_TOKEN,userTO,null),userWorkflow);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTO generateToken(@PathVariable("String_Node_Str") Long userId) throws WorkflowException, NotFoundException {
  UserTO userTO=new UserTO();
  userTO.setId(userId);
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_GENERATE_TOKEN,userTO.getId(),null),userWorkflow);
}
Program: 61304
Project: 61304
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO activate(@RequestBody UserTO userTO) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_ACTIVATE,userTO,Collections.singletonMap(Constants.TOKEN,(Object)userTO.getToken())),userWorkflow);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO activate(@RequestBody UserTO userTO) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(Constants.ACTION_ACTIVATE,userTO.getId(),Collections.singletonMap(Constants.TOKEN,(Object)userTO.getToken())),userWorkflow);
}
Program: 61306
Project: 61306
Buggy source:
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO executeAction(HttpServletResponse response,@RequestBody UserTO userTO,@PathVariable(value="String_Node_Str") String actionName) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(actionName,userTO,null),userWorkflow);
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO executeAction(HttpServletResponse response,@RequestBody UserTO userTO,@PathVariable(value="String_Node_Str") String actionName) throws WorkflowException, NotFoundException {
  return userDataBinder.getUserTO(doExecuteAction(actionName,userTO.getId(),null),userWorkflow);
}
Program: 61307
Project: 61307
Buggy source:
private Integer findWorkflowAction(Long workflowEntryId,String actionName){
  WorkflowDescriptor workflowDescriptor=userWorkflow.getWorkflowDescriptor(Constants.USER_WORKFLOW);
  int[] actions=userWorkflow.getAvailableActions(workflowEntryId,null);
  Integer actionId=null;
  for (int i=0; i < actions.length && actionId == null; i++) {
    if (actionName.equals(workflowDescriptor.getAction(actions[i]).getName())) {
      actionId=actions[i];
    }
  }
  Map<Integer,ActionDescriptor> commonActions=workflowDescriptor.getCommonActions();
  for (  Integer actionNumber : commonActions.keySet()) {
    if (actionName.equals(commonActions.get(actionNumber).getName())) {
      actionId=actionNumber;
    }
  }
  return actionId;
}

Fixed version (ground truth):
private Integer findWorkflowAction(Long workflowId,String actionName){
  WorkflowDescriptor workflowDescriptor=userWorkflow.getWorkflowDescriptor(Constants.USER_WORKFLOW);
  int[] actions=userWorkflow.getAvailableActions(workflowId,null);
  Integer actionId=null;
  for (int i=0; i < actions.length && actionId == null; i++) {
    if (actionName.equals(workflowDescriptor.getAction(actions[i]).getName())) {
      actionId=actions[i];
    }
  }
  Map<Integer,ActionDescriptor> commonActions=workflowDescriptor.getCommonActions();
  for (  Integer actionNumber : commonActions.keySet()) {
    if (actionName.equals(commonActions.get(actionNumber).getName())) {
      actionId=actionNumber;
    }
  }
  return actionId;
}
Program: 61308
Project: 61308
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public WorkflowActionsTO getActions(@PathVariable("String_Node_Str") Long userId) throws NotFoundException {
  SyncopeUser user=syncopeUserDAO.find(userId);
  if (user == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  WorkflowActionsTO result=new WorkflowActionsTO();
  WorkflowDescriptor workflowDescriptor=userWorkflow.getWorkflowDescriptor(Constants.USER_WORKFLOW);
  int[] availableActions=userWorkflow.getAvailableActions(user.getWorkflowEntryId(),Collections.EMPTY_MAP);
  for (int i=0; i < availableActions.length; i++) {
    result.addAction(workflowDescriptor.getAction(availableActions[i]).getName());
  }
  return result;
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public WorkflowActionsTO getActions(@PathVariable("String_Node_Str") Long userId) throws NotFoundException {
  SyncopeUser user=syncopeUserDAO.find(userId);
  if (user == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  WorkflowActionsTO result=new WorkflowActionsTO();
  WorkflowDescriptor workflowDescriptor=userWorkflow.getWorkflowDescriptor(Constants.USER_WORKFLOW);
  int[] availableActions=userWorkflow.getAvailableActions(user.getWorkflowId(),Collections.EMPTY_MAP);
  for (int i=0; i < availableActions.length; i++) {
    result.addAction(workflowDescriptor.getAction(availableActions[i]).getName());
  }
  return result;
}
Program: 61309
Project: 61309
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public ModelAndView getStatus(@PathVariable("String_Node_Str") Long userId) throws NotFoundException {
  SyncopeUser user=syncopeUserDAO.find(userId);
  if (user == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  List<Step> currentSteps=userWorkflow.getCurrentSteps(user.getWorkflowEntryId());
  if (currentSteps == null || currentSteps.isEmpty()) {
    return null;
  }
  ModelAndView mav=new ModelAndView();
  mav.addObject(currentSteps.iterator().next().getStatus());
  return mav;
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public ModelAndView getStatus(@PathVariable("String_Node_Str") Long userId) throws NotFoundException {
  SyncopeUser user=syncopeUserDAO.find(userId);
  if (user == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  List<Step> currentSteps=userWorkflow.getCurrentSteps(user.getWorkflowId());
  if (currentSteps == null || currentSteps.isEmpty()) {
    return null;
  }
  ModelAndView mav=new ModelAndView();
  mav.addObject(currentSteps.iterator().next().getStatus());
  return mav;
}
Program: 61310
Project: 61310
Buggy source:
@RequestMapping(method=RequestMethod.DELETE,value="String_Node_Str") public void delete(@PathVariable("String_Node_Str") Long userId) throws NotFoundException {
  SyncopeUser user=syncopeUserDAO.find(userId);
  if (user == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
 else {
    if (workflowStore != null && user.getWorkflowEntryId() != null) {
      workflowStore.delete(user.getWorkflowEntryId());
    }
    syncopeUserDAO.delete(userId);
  }
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.DELETE,value="String_Node_Str") public void delete(@PathVariable("String_Node_Str") Long userId) throws NotFoundException {
  SyncopeUser user=syncopeUserDAO.find(userId);
  if (user == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
 else {
    if (workflowStore != null && user.getWorkflowId() != null) {
      workflowStore.delete(user.getWorkflowId());
    }
    syncopeUserDAO.delete(userId);
  }
}
Program: 61311
Project: 61311
Buggy source:
public SyncopeUser doExecuteAction(String actionName,Long userId,Map<String,Object> moreInputs) throws WorkflowException, NotFoundException {
  SyncopeUser syncopeUser=syncopeUserDAO.find(userId);
  if (syncopeUser == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  Map<String,Object> inputs=new HashMap<String,Object>();
  if (moreInputs != null && !moreInputs.isEmpty()) {
    inputs.putAll(moreInputs);
  }
  inputs.put(Constants.SYNCOPE_USER,syncopeUser);
  Integer actionId=findWorkflowAction(syncopeUser.getWorkflowEntryId(),actionName);
  if (actionId == null) {
    throw new NotFoundException(actionName);
  }
  try {
    userWorkflow.doAction(syncopeUser.getWorkflowEntryId(),actionId,inputs);
  }
 catch (  InvalidActionException e) {
    throw new WorkflowException(e);
  }
  return syncopeUserDAO.save(syncopeUser);
}

Fixed version (ground truth):
public SyncopeUser doExecuteAction(String actionName,Long userId,Map<String,Object> moreInputs) throws WorkflowException, NotFoundException {
  SyncopeUser syncopeUser=syncopeUserDAO.find(userId);
  if (syncopeUser == null) {
    log.error("String_Node_Str" + userId + "String_Node_Str");
    throw new NotFoundException(String.valueOf(userId));
  }
  Map<String,Object> inputs=new HashMap<String,Object>();
  if (moreInputs != null && !moreInputs.isEmpty()) {
    inputs.putAll(moreInputs);
  }
  inputs.put(Constants.SYNCOPE_USER,syncopeUser);
  Integer actionId=findWorkflowAction(syncopeUser.getWorkflowId(),actionName);
  if (actionId == null) {
    throw new NotFoundException(actionName);
  }
  try {
    userWorkflow.doAction(syncopeUser.getWorkflowId(),actionId,inputs);
  }
 catch (  InvalidActionException e) {
    throw new WorkflowException(e);
  }
  return syncopeUserDAO.save(syncopeUser);
}
Program: 61313
Project: 61313
Buggy source:
public UserTO getUserTO(SyncopeUser user,Workflow userWorkflow){
  UserTO userTO=new UserTO();
  userTO.setId(user.getId());
  userTO.setCreationTime(user.getCreationTime());
  userTO.setToken(user.getToken());
  userTO.setTokenExpireTime(user.getTokenExpireTime());
  userTO.setPassword(user.getPassword());
  String status=null;
  try {
    List<Step> currentSteps=userWorkflow.getCurrentSteps(user.getWorkflowEntryId());
    if (currentSteps != null && !currentSteps.isEmpty()) {
      status=currentSteps.iterator().next().getStatus();
    }
 else {
      log.error("String_Node_Str" + user);
    }
  }
 catch (  EntityNotFoundException e) {
    log.error("String_Node_Str" + user.getWorkflowEntryId());
  }
  userTO.setStatus(status);
  userTO=(UserTO)fillTO(userTO,user.getAttributes(),user.getDerivedAttributes(),user.getResources());
  MembershipTO membershipTO=null;
  for (  Membership membership : user.getMemberships()) {
    membershipTO=new MembershipTO();
    membershipTO.setId(membership.getId());
    membershipTO.setRole(membership.getSyncopeRole().getId());
    membershipTO=(MembershipTO)fillTO(membershipTO,membership.getAttributes(),membership.getDerivedAttributes(),membership.getResources());
    userTO.addMembership(membershipTO);
  }
  return userTO;
}

Fixed version (ground truth):
public UserTO getUserTO(SyncopeUser user,Workflow userWorkflow){
  UserTO userTO=new UserTO();
  userTO.setId(user.getId());
  userTO.setCreationTime(user.getCreationTime());
  userTO.setToken(user.getToken());
  userTO.setTokenExpireTime(user.getTokenExpireTime());
  userTO.setPassword(user.getPassword());
  String status=null;
  try {
    List<Step> currentSteps=userWorkflow.getCurrentSteps(user.getWorkflowId());
    if (currentSteps != null && !currentSteps.isEmpty()) {
      status=currentSteps.iterator().next().getStatus();
    }
 else {
      log.error("String_Node_Str" + user);
    }
  }
 catch (  EntityNotFoundException e) {
    log.error("String_Node_Str" + user.getWorkflowId());
  }
  userTO.setStatus(status);
  userTO=(UserTO)fillTO(userTO,user.getAttributes(),user.getDerivedAttributes(),user.getResources());
  MembershipTO membershipTO=null;
  for (  Membership membership : user.getMemberships()) {
    membershipTO=new MembershipTO();
    membershipTO.setId(membership.getId());
    membershipTO.setRole(membership.getSyncopeRole().getId());
    membershipTO=(MembershipTO)fillTO(membershipTO,membership.getAttributes(),membership.getDerivedAttributes(),membership.getResources());
    userTO.addMembership(membershipTO);
  }
  return userTO;
}
Program: 61315
Project: 61315
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + exceptionOperation + "String_Node_Str"+ "String_Node_Str"+ syncopeUserId+ "String_Node_Str"+ "String_Node_Str"+ workflowEntryId+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + exceptionOperation + "String_Node_Str"+ "String_Node_Str"+ syncopeUserId+ "String_Node_Str"+ "String_Node_Str"+ workflowId+ "String_Node_Str"+ "String_Node_Str"+ workflowEntryId+ '}';
}
Program: 61316
Project: 61316
Buggy source:
/** 
 * Create a new user and start off the workflow.
 * @param userTO instance
 */
public void createUser(UserTO userTO){
  UserTO newUserTO;
  try {
    newUserTO=restClient.getRestTemplate().postForObject(restClient.getBaseURL() + "String_Node_Str",userTO,UserTO.class);
    userTO.setId(newUserTO.getId());
    userTO.setCreationTime(newUserTO.getCreationTime());
    userTO.setToken(newUserTO.getToken());
    userTO.setTokenExpireTime(newUserTO.getTokenExpireTime());
    newUserTO=restClient.getRestTemplate().postForObject(restClient.getBaseURL() + "String_Node_Str",newUserTO,UserTO.class);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Create a new user and start off the workflow.
 * @param userTO instance
 */
public void createUser(UserTO userTO){
  UserTO newUserTO;
  try {
    newUserTO=restClient.getRestTemplate().postForObject(restClient.getBaseURL() + "String_Node_Str",userTO,UserTO.class);
    userTO.setId(newUserTO.getId());
    userTO.setToken(newUserTO.getToken());
    userTO.setTokenExpireTime(newUserTO.getTokenExpireTime());
    newUserTO=restClient.getRestTemplate().postForObject(restClient.getBaseURL() + "String_Node_Str",newUserTO,UserTO.class);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    e.printStackTrace();
  }
}
Program: 61318
Project: 61318
Buggy source:
@Before public void setUpTestDataWithinTransaction() throws Exception {
  Connection conn=DataSourceUtils.getConnection(dataSource);
  IDatabaseConnection dbUnitConn=new DatabaseConnection(conn);
  DatabaseConfig config=dbUnitConn.getConfig();
  config.setProperty("String_Node_Str",dbUnitDataTypeFactory);
  FlatXmlDataSetBuilder dataSetBuilder=new FlatXmlDataSetBuilder();
  dataSetBuilder.setColumnSensing(true);
  IDataSet dataSet=dataSetBuilder.build(getClass().getResourceAsStream("String_Node_Str"));
  try {
    DatabaseOperation.CLEAN_INSERT.execute(dbUnitConn,dataSet);
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
 finally {
    DataSourceUtils.releaseConnection(conn,dataSource);
  }
  if (log.isDebugEnabled()) {
    conn=DataSourceUtils.getConnection(dataSource);
    DatabaseMetaData dbm=conn.getMetaData();
    String[] types={"String_Node_Str"};
    ResultSet rs=dbm.getTables(null,null,"String_Node_Str",types);
    while (rs.next()) {
      logTableContent(conn,rs.getString("String_Node_Str"));
    }
    try {
      rs.close();
      conn.close();
    }
 catch (    SQLException e) {
    }
  }
}

Fixed version (ground truth):
@Before public void setUpTestDataWithinTransaction() throws Exception {
  Connection conn=DataSourceUtils.getConnection(dataSource);
  IDatabaseConnection dbUnitConn=new DatabaseConnection(conn);
  DatabaseConfig config=dbUnitConn.getConfig();
  config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY,dbUnitDataTypeFactory);
  FlatXmlDataSetBuilder dataSetBuilder=new FlatXmlDataSetBuilder();
  dataSetBuilder.setColumnSensing(true);
  IDataSet dataSet=dataSetBuilder.build(getClass().getResourceAsStream("String_Node_Str"));
  try {
    DatabaseOperation.CLEAN_INSERT.execute(dbUnitConn,dataSet);
  }
 catch (  Throwable t) {
    log.error("String_Node_Str",t);
  }
 finally {
    DataSourceUtils.releaseConnection(conn,dataSource);
  }
  if (log.isDebugEnabled()) {
    conn=DataSourceUtils.getConnection(dataSource);
    DatabaseMetaData dbm=conn.getMetaData();
    String[] types={"String_Node_Str"};
    ResultSet rs=dbm.getTables(null,null,"String_Node_Str",types);
    while (rs.next()) {
      logTableContent(conn,rs.getString("String_Node_Str"));
    }
    try {
      rs.close();
      conn.close();
    }
 catch (    SQLException e) {
    }
  }
}
Program: 61319
Project: 61319
Buggy source:
/** 
 * Create the user on every associated resource. It is possible to ask for a synchronous provisioning for some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if the creation fails onto a synchronous resource.
 * @param user to be created.
 * @param syncResourceNames to ask for a synchronous or asynchronous provisioning.
 * @return a set of provisioned resources.
 * @throws PropagationException
 */
public Set<String> create(SyncopeUser user,Set<String> syncResourceNames) throws PropagationException {
  Set<TargetResource> resources=new HashSet<TargetResource>();
  for (  TargetResource resource : user.getTargetResources()) {
    resources.add(resource);
  }
  for (  Membership membership : user.getMemberships()) {
    resources.addAll(membership.getTargetResources());
  }
  ResourceOperations resourceOperations=new ResourceOperations();
  resourceOperations.set(Type.CREATE,resources);
  return provision(user,resourceOperations,syncResourceNames);
}

Fixed version (ground truth):
/** 
 * Create the user on every associated resource. It is possible to ask for a synchronous provisioning for some resources specifying a set of resource names. Exceptions won't be ignored and the process will be stopped if the creation fails onto a synchronous resource.
 * @param user to be created.
 * @param syncResourceNames to ask for a synchronous or asynchronous provisioning.
 * @return a set of provisioned resources.
 * @throws PropagationException
 */
public Set<String> create(SyncopeUser user,Set<String> syncResourceNames) throws PropagationException {
  Set<TargetResource> resources=new HashSet<TargetResource>();
  for (  TargetResource resource : user.getTargetResources()) {
    resources.add(resource);
  }
  for (  Membership membership : user.getMemberships()) {
    resources.addAll(membership.getSyncopeRole().getTargetResources());
  }
  ResourceOperations resourceOperations=new ResourceOperations();
  resourceOperations.set(Type.CREATE,resources);
  return provision(user,resourceOperations,syncResourceNames);
}
Program: 61321
Project: 61321
Buggy source:
/** 
 * Creates user account.
 */
@Test public void create(){
  Set<Attribute> attrs=new HashSet<Attribute>();
  attrs.add(new Name("String_Node_Str"));
  attrs.add(AttributeBuilder.buildPassword("String_Node_Str".toCharArray()));
  attrs.add(AttributeBuilder.build("String_Node_Str","String_Node_Str"));
  attrs.add(AttributeBuilder.build("String_Node_Str",true));
  attrs.add(AttributeBuilder.build("String_Node_Str","String_Node_Str"));
  Uid userUid=connector.create(ObjectClass.ACCOUNT,attrs,null);
  assertNotNull(userUid);
  assertEquals("String_Node_Str",userUid.getUidValue());
}

Fixed version (ground truth):
/** 
 * Creates user account.
 */
@Test public void create(){
  Set<Attribute> attrs=new HashSet<Attribute>();
  attrs.add(new Name("String_Node_Str"));
  attrs.add(AttributeBuilder.buildPassword("String_Node_Str".toCharArray()));
  attrs.add(AttributeBuilder.build("String_Node_Str","String_Node_Str"));
  attrs.add(AttributeBuilder.build("String_Node_Str","String_Node_Str"));
  attrs.add(AttributeBuilder.build("String_Node_Str","String_Node_Str"));
  attrs.add(AttributeBuilder.build("String_Node_Str","String_Node_Str"));
  Uid userUid=connector.create(ObjectClass.ACCOUNT,attrs,null);
  assertNotNull(userUid);
  assertEquals("String_Node_Str",userUid.getUidValue());
}
Program: 61322
Project: 61322
Buggy source:
public void setKey(boolean key){
  this.key=key;
  this.nullable=false;
}

Fixed version (ground truth):
public void setKey(boolean key){
  this.key=key;
  if (key)   this.nullable=false;
}
Program: 61324
Project: 61324
Buggy source:
@Test public void create(){
  Throwable t=null;
  try {
    WSAttributeValue uid=new WSAttributeValue();
    uid.setName("String_Node_Str");
    uid.setValue("String_Node_Str");
    uid.setKey(true);
    WSAttributeValue password=new WSAttributeValue();
    password.setName("String_Node_Str");
    password.setValue("String_Node_Str");
    password.setPassword(true);
    WSAttributeValue name=new WSAttributeValue();
    name.setName("String_Node_Str");
    name.setValue("String_Node_Str");
    WSAttributeValue surname=new WSAttributeValue();
    surname.setName("String_Node_Str");
    surname.setValue("String_Node_Str");
    WSAttributeValue privacy=new WSAttributeValue();
    privacy.setName("String_Node_Str");
    privacy.setValue(Boolean.TRUE);
    WSAttributeValue birthday=new WSAttributeValue();
    birthday.setName("String_Node_Str");
    birthday.setValue("String_Node_Str");
    List<WSAttributeValue> attrs=new ArrayList<WSAttributeValue>();
    attrs.add(uid);
    attrs.add(password);
    attrs.add(name);
    attrs.add(surname);
    attrs.add(privacy);
    attrs.add(birthday);
    provisioning.create(attrs);
  }
 catch (  Exception e) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str",e);
    }
    t=e;
  }
  assertNull(t);
}

Fixed version (ground truth):
@Test public void create(){
  Throwable t=null;
  try {
    WSAttributeValue uid=new WSAttributeValue();
    uid.setName("String_Node_Str");
    uid.setValue("String_Node_Str");
    uid.setKey(true);
    WSAttributeValue password=new WSAttributeValue();
    password.setName("String_Node_Str");
    password.setValue("String_Node_Str");
    password.setPassword(true);
    WSAttributeValue type=new WSAttributeValue();
    type.setName("String_Node_Str");
    type.setValue("String_Node_Str");
    WSAttributeValue name=new WSAttributeValue();
    name.setName("String_Node_Str");
    name.setValue("String_Node_Str");
    WSAttributeValue surname=new WSAttributeValue();
    surname.setName("String_Node_Str");
    surname.setValue("String_Node_Str");
    WSAttributeValue birthdate=new WSAttributeValue();
    birthdate.setName("String_Node_Str");
    birthdate.setValue("String_Node_Str");
    List<WSAttributeValue> attrs=new ArrayList<WSAttributeValue>();
    attrs.add(uid);
    attrs.add(password);
    attrs.add(type);
    attrs.add(name);
    attrs.add(surname);
    attrs.add(birthdate);
    provisioning.create(attrs);
  }
 catch (  Exception e) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str",e);
    }
    t=e;
  }
  assertNull(t);
}
Program: 61325
Project: 61325
Buggy source:
public void setType(SchemaType type){
  this.type=type;
}

Fixed version (ground truth):
public void setType(SchemaValueType type){
  this.type=type;
}
Program: 61326
Project: 61326
Buggy source:
public SchemaType getType(){
  return type;
}

Fixed version (ground truth):
public SchemaValueType getType(){
  return type;
}
Program: 61327
Project: 61327
Buggy source:
public Set<Membership> getMemberships(){
  return memberships;
}

Fixed version (ground truth):
public List<Membership> getMemberships(){
  return memberships;
}
Program: 61328
Project: 61328
Buggy source:
public void setMemberships(Set<Membership> memberships){
  this.memberships=memberships;
}

Fixed version (ground truth):
public void setMemberships(List<Membership> memberships){
  this.memberships=memberships;
}
Program: 61329
Project: 61329
Buggy source:
public SyncopeRole(){
  memberships=new HashSet<Membership>();
  entitlements=new HashSet<Entitlement>();
  attributes=new HashSet<RoleAttribute>();
  derivedAttributes=new HashSet<RoleDerivedAttribute>();
}

Fixed version (ground truth):
public SyncopeRole(){
  memberships=new ArrayList<Membership>();
  entitlements=new HashSet<Entitlement>();
  attributes=new HashSet<RoleAttribute>();
  derivedAttributes=new HashSet<RoleDerivedAttribute>();
}
Program: 61330
Project: 61330
Buggy source:
public Set<Membership> getMemberships(){
  return memberships;
}

Fixed version (ground truth):
public List<Membership> getMemberships(){
  return memberships;
}
Program: 61331
Project: 61331
Buggy source:
public void setMemberships(Set<Membership> memberships){
  this.memberships=memberships;
}

Fixed version (ground truth):
public void setMemberships(List<Membership> memberships){
  this.memberships=memberships;
}
Program: 61332
Project: 61332
Buggy source:
public SyncopeUser(){
  memberships=new HashSet<Membership>();
  attributes=new HashSet<UserAttribute>();
  derivedAttributes=new HashSet<UserDerivedAttribute>();
}

Fixed version (ground truth):
public SyncopeUser(){
  memberships=new ArrayList<Membership>();
  attributes=new HashSet<UserAttribute>();
  derivedAttributes=new HashSet<UserDerivedAttribute>();
}
Program: 61333
Project: 61333
Buggy source:
@Override @Transactional public void delete(Long id){
  Membership membership=find(id);
  if (id == null) {
    return;
  }
  membership.getSyncopeUser().removeMembership(membership);
  membership.setSyncopeUser(null);
  membership.getSyncopeRole().removeMembership(membership);
  membership.setSyncopeRole(null);
  entityManager.remove(membership);
}

Fixed version (ground truth):
@Override @Transactional public void delete(Long id){
  Membership membership=find(id);
  if (membership == null) {
    return;
  }
  membership.getSyncopeUser().removeMembership(membership);
  membership.setSyncopeUser(null);
  membership.getSyncopeRole().removeMembership(membership);
  membership.setSyncopeRole(null);
  entityManager.remove(membership);
}