nus-yam/ex-repair huggingface dataset:
Program: 61334
Project: 61334
Buggy source:
@Override @Transactional public void delete(Long id){
  SyncopeRole role=find(id);
  if (id == null) {
    return;
  }
  Query query=entityManager.createQuery("String_Node_Str" + "String_Node_Str");
  query.setParameter("String_Node_Str",id);
  List<SyncopeRole> childrenRoles=query.getResultList();
  for (  SyncopeRole child : childrenRoles) {
    delete(child.getId());
  }
  for (  Membership membership : role.getMemberships()) {
    membership.setSyncopeRole(null);
    membership.getSyncopeUser().removeMembership(membership);
    membership.setSyncopeRole(null);
    entityManager.remove(membership);
  }
  role.setMemberships(Collections.EMPTY_SET);
  for (  Entitlement entitlement : role.getEntitlements()) {
    entitlement.removeRole(role);
  }
  role.setEntitlements(Collections.EMPTY_SET);
  role.setParent(null);
  entityManager.remove(role);
}

Fixed version (ground truth):
@Override @Transactional public void delete(Long id){
  SyncopeRole role=find(id);
  if (id == null) {
    return;
  }
  Query query=entityManager.createQuery("String_Node_Str" + "String_Node_Str");
  query.setParameter("String_Node_Str",id);
  List<SyncopeRole> childrenRoles=query.getResultList();
  for (  SyncopeRole child : childrenRoles) {
    delete(child.getId());
  }
  for (  Membership membership : role.getMemberships()) {
    membership.setSyncopeRole(null);
    membership.getSyncopeUser().removeMembership(membership);
    membership.setSyncopeRole(null);
    entityManager.remove(membership);
  }
  role.setMemberships(Collections.EMPTY_LIST);
  for (  Entitlement entitlement : role.getEntitlements()) {
    entitlement.removeRole(role);
  }
  role.setEntitlements(Collections.EMPTY_SET);
  role.setParent(null);
  entityManager.remove(role);
}
Program: 61335
Project: 61335
Buggy source:
@Override @Transactional public void delete(Long id){
  SyncopeUser user=find(id);
  if (id == null) {
    return;
  }
  for (  Membership membership : user.getMemberships()) {
    membership.setSyncopeUser(null);
    membership.getSyncopeRole().removeMembership(membership);
    membership.setSyncopeRole(null);
    entityManager.remove(membership);
  }
  user.setMemberships(Collections.EMPTY_SET);
  entityManager.remove(user);
}

Fixed version (ground truth):
@Override @Transactional public void delete(Long id){
  SyncopeUser user=find(id);
  if (id == null) {
    return;
  }
  for (  Membership membership : user.getMemberships()) {
    membership.setSyncopeUser(null);
    membership.getSyncopeRole().removeMembership(membership);
    membership.setSyncopeRole(null);
    entityManager.remove(membership);
  }
  user.setMemberships(Collections.EMPTY_LIST);
  entityManager.remove(user);
}
Program: 61336
Project: 61336
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);
  WorkflowDescriptor workflowDescriptor=userWorkflow.getWorkflowDescriptor(Constants.USER_WORKFLOW);
  int[] actions=userWorkflow.getAvailableActions(syncopeUser.getWorkflowEntryId(),inputs);
  Integer actionId=null;
  for (int i=0; i < actions.length && actionId == null; i++) {
    if (actionName.equals(workflowDescriptor.getAction(actions[i]).getName())) {
      actionId=actions[i];
    }
  }
  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,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);
}
Program: 61339
Project: 61339
Buggy source:
@Override public void execute(Map transientVars,Map args,PropertySet ps) throws WorkflowException {
  AbstractAttribute attribute=getAttribute(transientVars,args);
  UserAttributeValue date=new UserAttributeValue();
  date.setDateValue(new Date());
  date.setAttribute(attribute);
  if (attribute.getSchema().isMultivalue()) {
    attribute.addAttributeValue(date);
  }
 else {
    attribute.setAttributeValues(Collections.singletonList(date));
  }
}

Fixed version (ground truth):
@Override public void execute(Map transientVars,Map args,PropertySet ps) throws WorkflowException {
  AbstractAttribute attribute=getAttribute(transientVars,args);
  AbstractAttributeValue date=attributableUtil.newAttributeValue();
  date.setDateValue(new Date());
  date.setAttribute(attribute);
  if (attribute.getSchema().isMultivalue()) {
    attribute.addAttributeValue(date);
  }
 else {
    attribute.setAttributeValues(Collections.singletonList(date));
  }
}
Program: 61340
Project: 61340
Buggy source:
@Override public void execute(Map transientVars,Map args,PropertySet ps) throws WorkflowException {
  AbstractAttribute attribute=getAttribute(transientVars,args);
  String text=(String)transientVars.get(args.get("String_Node_Str"));
  if (text == null) {
    throw new WorkflowException("String_Node_Str");
  }
  UserAttributeValue textAttributeValue=new UserAttributeValue();
  textAttributeValue.setStringValue(text);
  textAttributeValue.setAttribute(attribute);
  if (attribute.getSchema().isMultivalue()) {
    attribute.addAttributeValue(textAttributeValue);
  }
 else {
    attribute.setAttributeValues(Collections.singletonList(textAttributeValue));
  }
}

Fixed version (ground truth):
@Override public void execute(Map transientVars,Map args,PropertySet ps) throws WorkflowException {
  AbstractAttribute attribute=getAttribute(transientVars,args);
  String text=(String)transientVars.get(args.get("String_Node_Str"));
  if (text == null) {
    throw new WorkflowException("String_Node_Str");
  }
  AbstractAttributeValue textAttributeValue=attributableUtil.newAttributeValue();
  textAttributeValue.setStringValue(text);
  textAttributeValue.setAttribute(attribute);
  if (attribute.getSchema().isMultivalue()) {
    attribute.addAttributeValue(textAttributeValue);
  }
 else {
    attribute.setAttributeValues(Collections.singletonList(textAttributeValue));
  }
}
Program: 61342
Project: 61342
Buggy source:
public RoleTO(){
  super();
  users=new HashSet<Long>();
  resources=new HashSet<String>();
}

Fixed version (ground truth):
public RoleTO(){
  super();
  resources=new HashSet<String>();
}
Program: 61343
Project: 61343
Buggy source:
public UserTO(){
  super();
  roles=new HashSet<Long>();
}

Fixed version (ground truth):
public UserTO(){
  super();
  memberships=new HashSet<MembershipTO>();
}
Program: 61344
Project: 61344
Buggy source:
public boolean removeResource(Resource resource){
  if (this.resources == null)   return true;
  return resources.remove(resource);
}

Fixed version (ground truth):
public boolean removeResource(Resource resource){
  return resources == null ? true : resources.remove(resource);
}
Program: 61345
Project: 61345
Buggy source:
public Set<Resource> getResources(){
  if (this.resources == null) {
    this.resources=new HashSet<Resource>();
  }
  return this.resources;
}

Fixed version (ground truth):
public Set<Resource> getResources(){
  return resources == null ? Collections.EMPTY_SET : resources;
}
Program: 61346
Project: 61346
Buggy source:
public boolean addResource(Resource resource){
  if (this.resources == null)   this.resources=new HashSet<Resource>();
  return this.resources.add(resource);
}

Fixed version (ground truth):
public boolean addResource(Resource resource){
  if (this.resources == null) {
    this.resources=new HashSet<Resource>();
  }
  return this.resources.add(resource);
}
Program: 61348
Project: 61348
Buggy source:
public void delete(Long entryId){
  HibernateWorkflowEntry entry=entityManager.find(HibernateWorkflowEntry.class,entryId);
  if (entry != null) {
    entityManager.remove(entry);
  }
}

Fixed version (ground truth):
public void delete(Long entryId){
  HibernateWorkflowEntry entry=entityManager.find(HibernateWorkflowEntry.class,entryId);
  if (entry != null) {
    entityManager.remove(entry);
  }
  List<OSWorkflowProperty> properties=osWorkflowPropertyDAO.findAll(entryId);
  if (properties != null) {
    for (    OSWorkflowProperty property : properties) {
      osWorkflowPropertyDAO.delete(property.getId());
    }
  }
}
Program: 61350
Project: 61350
Buggy source:
@Override protected HtmlEmail getHtmlEmail(Map<String,String> args,SyncopeUser syncopeUser) throws EmailException, WorkflowException {
  String urlSuffix="String_Node_Str";
  if (Boolean.valueOf(args.get("String_Node_Str"))) {
    try {
      urlSuffix+="String_Node_Str" + syncopeConfigurationDAO.find("String_Node_Str").getConfValue() + "String_Node_Str"+ URLEncoder.encode(syncopeUser.getToken(),"String_Node_Str");
    }
 catch (    Throwable t) {
      log.error("String_Node_Str",t);
    }
  }
  HtmlEmail email=super.getHtmlEmail(args,syncopeUser);
  email.addTo(Utils.getUserId(syncopeUser));
  try {
    email.setHtmlMsg(getEmailBody(syncopeConfigurationDAO.find("String_Node_Str").getConfValue(),syncopeConfigurationDAO.find(args.get("String_Node_Str")).getConfValue(),urlSuffix,urlSuffix.substring(0,urlSuffix.indexOf('=') + 1)));
    email.setTextMsg(getEmailBody(syncopeConfigurationDAO.find("String_Node_Str").getConfValue(),syncopeConfigurationDAO.find(args.get("String_Node_Str")).getConfValue(),urlSuffix,urlSuffix.substring(0,urlSuffix.indexOf('=') + 1)));
  }
 catch (  MissingConfKeyException e) {
    new WorkflowException(e);
  }
  return email;
}

Fixed version (ground truth):
@Override protected HtmlEmail getHtmlEmail(Map<String,String> args,SyncopeUser syncopeUser) throws EmailException, WorkflowException {
  String urlSuffix="String_Node_Str";
  if (Boolean.valueOf(args.get("String_Node_Str"))) {
    try {
      urlSuffix+="String_Node_Str" + syncopeConfigurationDAO.find("String_Node_Str").getConfValue() + "String_Node_Str"+ URLEncoder.encode(syncopeUser.getToken(),"String_Node_Str")+ "String_Node_Str"+ Utils.getUserId(syncopeUser);
    }
 catch (    Throwable t) {
      log.error("String_Node_Str",t);
    }
  }
  HtmlEmail email=super.getHtmlEmail(args,syncopeUser);
  email.addTo(Utils.getUserId(syncopeUser));
  try {
    email.setHtmlMsg(getEmailBody(syncopeConfigurationDAO.find("String_Node_Str").getConfValue(),syncopeConfigurationDAO.find(args.get("String_Node_Str")).getConfValue(),urlSuffix,urlSuffix.substring(0,urlSuffix.indexOf('=') + 1)));
    email.setTextMsg(getEmailBody(syncopeConfigurationDAO.find("String_Node_Str").getConfValue(),syncopeConfigurationDAO.find(args.get("String_Node_Str")).getConfValue(),urlSuffix,urlSuffix.substring(0,urlSuffix.indexOf('=') + 1)));
  }
 catch (  MissingConfKeyException e) {
    new WorkflowException(e);
  }
  return email;
}
Program: 61352
Project: 61352
Buggy source:
/** 
 * @see http://commons.apache.org/jexl/reference/index.html
 * @return
 */
public String getValue(Set<? extends AbstractAttribute> attributes){
  Expression jexlExpression=jexlEngine.createExpression(getDerivedSchema().getExpression());
  JexlContext jexlContext=new MapContext();
  Set<? extends AbstractAttributeValue> attributeValues=null;
  String expressionValue=null;
  AbstractAttribute attribute=null;
  AbstractAttributeValue attributeValue=null;
  for (Iterator<? extends AbstractAttribute> itor=attributes.iterator(); itor.hasNext(); ) {
    attribute=itor.next();
    attributeValues=attribute.getAttributeValues();
    if (attributeValues.isEmpty() || !getDerivedSchema().getSchemas().contains(attribute.getSchema())) {
      expressionValue="String_Node_Str";
    }
 else {
      attributeValue=attributeValues.iterator().next();
      expressionValue=attributeValue.getValueAsString();
    }
    jexlContext.set(attribute.getSchema().getName(),expressionValue);
  }
  return jexlExpression.evaluate(jexlContext).toString();
}

Fixed version (ground truth):
/** 
 * @see http://commons.apache.org/jexl/reference/index.html
 * @return
 */
public String getValue(Collection<? extends AbstractAttribute> attributes){
  Expression jexlExpression=jexlEngine.createExpression(getDerivedSchema().getExpression());
  JexlContext jexlContext=new MapContext();
  Set<? extends AbstractAttributeValue> attributeValues=null;
  String expressionValue=null;
  AbstractAttribute attribute=null;
  AbstractAttributeValue attributeValue=null;
  for (Iterator<? extends AbstractAttribute> itor=attributes.iterator(); itor.hasNext(); ) {
    attribute=itor.next();
    attributeValues=attribute.getAttributeValues();
    if (attributeValues.isEmpty() || !getDerivedSchema().getSchemas().contains(attribute.getSchema())) {
      expressionValue="String_Node_Str";
    }
 else {
      attributeValue=attributeValues.iterator().next();
      expressionValue=attributeValue.getValueAsString();
    }
    jexlContext.set(attribute.getSchema().getName(),expressionValue);
  }
  return jexlExpression.evaluate(jexlContext).toString();
}
Program: 61354
Project: 61354
Buggy source:
public RoleTO getRoleTO(SyncopeRole role){
  RoleTO roleTO=new RoleTO();
  roleTO.setId(role.getId());
  roleTO.setName(role.getName());
  if (role.getParent() != null) {
    roleTO.setParent(role.getParent().getId());
  }
  roleTO=getAbstractAttributableTO(roleTO,role);
  for (  SyncopeUser user : role.getUsers()) {
    roleTO.addUser(user.getId());
  }
  return roleTO;
}

Fixed version (ground truth):
public RoleTO getRoleTO(SyncopeRole role){
  RoleTO roleTO=new RoleTO();
  roleTO.setId(role.getId());
  roleTO.setName(role.getName());
  roleTO.setInheritAttributes(role.isInheritAttributes());
  roleTO.setInheritDerivedAttributes(role.isInheritDerivedAttributes());
  if (role.getParent() != null) {
    roleTO.setParent(role.getParent().getId());
  }
  roleTO=getAbstractAttributableTO(roleTO,role);
  for (  SyncopeUser user : role.getUsers()) {
    roleTO.addUser(user.getId());
  }
  AttributeTO attributeTO=null;
  List<RoleAttribute> inheritedAttributes=null;
  if (role.isInheritAttributes()) {
    inheritedAttributes=syncopeRoleDAO.findInheritedAttributes(role);
    for (    AbstractAttribute attribute : inheritedAttributes) {
      attributeTO=new AttributeTO();
      attributeTO.setSchema(attribute.getSchema().getName());
      attributeTO.setValues(attribute.getAttributeValuesAsStrings());
      roleTO.addAttribute(attributeTO);
    }
    List<RoleDerivedAttribute> inheritedDerivedAttributes=null;
    if (role.isInheritDerivedAttributes()) {
      inheritedDerivedAttributes=syncopeRoleDAO.findInheritedDerivedAttributes(role);
      for (      AbstractDerivedAttribute attribute : inheritedDerivedAttributes) {
        attributeTO=new AttributeTO();
        attributeTO.setSchema(attribute.getDerivedSchema().getName());
        attributeTO.setValues(Collections.singleton(attribute.getValue(inheritedAttributes)));
        roleTO.addDerivedAttribute(attributeTO);
      }
    }
  }
  return roleTO;
}
Program: 61355
Project: 61355
Buggy source:
/** 
 * Implementation of the provisioning feature.
 * @param user
 * @param synchronous
 * @param merge
 * @return
 */
private Set<String> provision(SyncopeUser user,boolean synchronous,boolean merge){
  Set<String> provisioned=new HashSet<String>();
  Set<Resource> resources=user.getResources();
  Set<SyncopeRole> roles=user.getRoles();
  for (  SyncopeRole role : roles) {
    resources.addAll(role.getResources());
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + resources + "String_Node_Str"+ user.getId());
  }
  for (  Resource resource : resources) {
    try {
      propagate(user,resource,merge);
      provisioned.add(resource.getName());
    }
 catch (    RuntimeException re) {
      if (log.isErrorEnabled()) {
        log.error("String_Node_Str" + resource.getName(),re);
      }
      if (synchronous) {
        throw re;
      }
    }
catch (    Throwable t) {
      if (log.isErrorEnabled()) {
        log.error("String_Node_Str" + resource.getName(),t);
      }
      if (synchronous) {
        throw new RuntimeException(t.getMessage());
      }
    }
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + provisioned + "String_Node_Str"+ user.getId());
  }
  return provisioned;
}

Fixed version (ground truth):
/** 
 * Implementation of the provisioning feature.
 * @param user
 * @param synchronous
 * @param merge
 * @return
 */
private Set<String> provision(SyncopeUser user,Set<String> synchronous,boolean merge){
  if (synchronous == null) {
    synchronous=Collections.EMPTY_SET;
  }
  Set<String> provisioned=new HashSet<String>();
  Set<Resource> resources=user.getResources();
  Set<SyncopeRole> roles=user.getRoles();
  for (  SyncopeRole role : roles) {
    resources.addAll(role.getResources());
  }
  Set<Resource> syncResources=new HashSet<Resource>();
  Set<Resource> asyncResources=new HashSet<Resource>();
  for (  Resource resource : resources) {
    if (synchronous.contains(resource.getName())) {
      syncResources.add(resource);
    }
 else {
      asyncResources.add(resource);
    }
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + resources + "String_Node_Str"+ user.getId());
  }
  for (  Resource resource : syncResources) {
    try {
      propagate(user,resource,merge);
      provisioned.add(resource.getName());
    }
 catch (    Throwable t) {
      if (log.isErrorEnabled()) {
        log.error("String_Node_Str" + resource.getName(),t);
      }
      throw new RuntimeException(t);
    }
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + resources + "String_Node_Str"+ user.getId());
  }
  for (  Resource resource : asyncResources) {
    try {
      propagate(user,resource,merge);
      provisioned.add(resource.getName());
    }
 catch (    Throwable t) {
      if (log.isErrorEnabled()) {
        log.error("String_Node_Str" + resource.getName(),t);
      }
    }
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + provisioned + "String_Node_Str"+ user.getId());
  }
  return provisioned;
}
Program: 61356
Project: 61356
Buggy source:
/** 
 * Performs update on each resource associated to the user. If we ask for a synchronous update passing true as second argument, than exceptions won't be ignored but the process will be stoppend and a runtime exception will be returned.
 * @param user to be updated.
 * @param synchronous to ask for a synchronous or asynchronous update.
 * @return a set of updated resources.
 */
public Set<String> update(SyncopeUser user,boolean synchronous){
  return provision(user,synchronous,true);
}

Fixed version (ground truth):
/** 
 * Performs update on each resource associated to the user. 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 stoppend if the provisioning fails onto a synchronous resource.
 * @param user to be updated.
 * @param synchronous to ask for a synchronous or asynchronous update.
 * @return a set of updated resources.
 */
public Set<String> update(SyncopeUser user,Set<String> synchronous){
  return provision(user,synchronous,true);
}
Program: 61357
Project: 61357
Buggy source:
public Resource getResource(Resource resource,ResourceTO resourceTO) throws SyncopeClientCompositeErrorException {
  SyncopeClientCompositeErrorException compositeErrorException=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
  SyncopeClientException requiredValuesMissing=new SyncopeClientException(SyncopeClientExceptionType.RequiredValueMissing);
  if (resourceTO == null)   return null;
  if (resourceTO.getName() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  ConnectorInstance connector=null;
  if (resourceTO.getConnectorId() != null) {
    connector=connectoInstanceDAO.find(resourceTO.getConnectorId());
  }
  if (connector == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (!requiredValuesMissing.getElements().isEmpty()) {
    compositeErrorException.addException(requiredValuesMissing);
  }
  if (compositeErrorException.hasExceptions()) {
    throw compositeErrorException;
  }
  resource.setName(resourceTO.getName());
  resource.setMappings(getSchemaMappings(resource,resourceTO.getMappings()));
  resource.setConnector(connector);
  return resource;
}

Fixed version (ground truth):
public Resource getResource(Resource resource,ResourceTO resourceTO) throws SyncopeClientCompositeErrorException {
  SyncopeClientCompositeErrorException compositeErrorException=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
  SyncopeClientException requiredValuesMissing=new SyncopeClientException(SyncopeClientExceptionType.RequiredValueMissing);
  if (resourceTO == null)   return null;
  if (resourceTO.getName() == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  ConnectorInstance connector=null;
  if (resourceTO.getConnectorId() != null) {
    connector=connectorInstanceDAO.find(resourceTO.getConnectorId());
  }
  if (connector == null) {
    requiredValuesMissing.addElement("String_Node_Str");
  }
  if (!requiredValuesMissing.getElements().isEmpty()) {
    compositeErrorException.addException(requiredValuesMissing);
  }
  if (compositeErrorException.hasExceptions()) {
    throw compositeErrorException;
  }
  resource.setName(resourceTO.getName());
  resource.setMappings(getSchemaMappings(resource,resourceTO.getMappings()));
  resource.setConnector(connector);
  connector.addResource(resource);
  return resource;
}
Program: 61358
Project: 61358
Buggy source:
@Autowired public ResourceDataBinder(SchemaDAO schemaDAO,ConnectorInstanceDAO connectorInstanceDAO){
  this.schemaDAO=schemaDAO;
  this.connectoInstanceDAO=connectorInstanceDAO;
}

Fixed version (ground truth):
@Autowired public ResourceDataBinder(SchemaDAO schemaDAO,ConnectorInstanceDAO connectorInstanceDAO){
  this.schemaDAO=schemaDAO;
  this.connectorInstanceDAO=connectorInstanceDAO;
}
Program: 61359
Project: 61359
Buggy source:
@Test public final void updateWithException(){
  SyncopeUser user=syncopeUserDAO.find(4L);
  assertNotNull(user);
  Resource resource=resourceDAO.find("String_Node_Str");
  assertNotNull(resource);
  user.setResources(Collections.singleton(resource));
  RuntimeException re=null;
  try {
    PropagationManager propagationManager=new PropagationManager();
    propagationManager.update(user,true);
  }
 catch (  RuntimeException e) {
    re=e;
  }
  assertNotNull(re);
}

Fixed version (ground truth):
@Test public final void updateWithException(){
  SyncopeUser user=syncopeUserDAO.find(4L);
  assertNotNull(user);
  Resource resource=resourceDAO.find("String_Node_Str");
  assertNotNull(resource);
  user.setResources(Collections.singleton(resource));
  RuntimeException re=null;
  try {
    PropagationManager propagationManager=new PropagationManager();
    propagationManager.update(user,Collections.singleton("String_Node_Str"));
  }
 catch (  RuntimeException e) {
    re=e;
  }
  assertNotNull(re);
}
Program: 61360
Project: 61360
Buggy source:
@Test public final void provisionWithException(){
  SyncopeUser user=syncopeUserDAO.find(3L);
  assertNotNull(user);
  Resource resource=resourceDAO.find("String_Node_Str");
  assertNotNull(resource);
  user.setResources(Collections.singleton(resource));
  RuntimeException re=null;
  try {
    PropagationManager propagationManager=new PropagationManager();
    propagationManager.provision(user,true);
  }
 catch (  RuntimeException e) {
    re=e;
  }
  assertNotNull(re);
}

Fixed version (ground truth):
@Test public final void provisionWithException(){
  SyncopeUser user=syncopeUserDAO.find(3L);
  assertNotNull(user);
  Resource resource=resourceDAO.find("String_Node_Str");
  assertNotNull(resource);
  user.setResources(Collections.singleton(resource));
  RuntimeException re=null;
  try {
    PropagationManager propagationManager=new PropagationManager();
    propagationManager.provision(user,Collections.singleton("String_Node_Str"));
  }
 catch (  RuntimeException e) {
    re=e;
  }
  assertNotNull(re);
}
Program: 61361
Project: 61361
Buggy source:
@Test public void create(){
  final String resourceName="String_Node_Str";
  ResourceTO resourceTO=new ResourceTO();
  resourceTO.setName(resourceName);
  resourceTO.setConnectorId(100L);
  SchemaMappingTOs schemaMappingTOs=new SchemaMappingTOs();
  SchemaMappingTO schemaMappingTO=null;
  for (int i=0; i < 3; i++) {
    schemaMappingTO=new SchemaMappingTO();
    schemaMappingTO.setField("String_Node_Str" + i);
    schemaMappingTO.setUserSchema("String_Node_Str");
    schemaMappingTO.setRoleSchema("String_Node_Str");
    schemaMappingTOs.addMapping(schemaMappingTO);
  }
  resourceTO.setMappings(schemaMappingTOs);
  ResourceTO actual=restTemplate.postForObject(BASE_URL + "String_Node_Str",resourceTO,ResourceTO.class);
  assertNotNull(actual);
  actual=restTemplate.getForObject(BASE_URL + "String_Node_Str",ResourceTO.class,resourceName);
  assertNotNull(actual);
}

Fixed version (ground truth):
@Test public void create(){
  final String resourceName="String_Node_Str";
  ResourceTO resourceTO=new ResourceTO();
  resourceTO.setName(resourceName);
  resourceTO.setConnectorId(102L);
  SchemaMappingTOs schemaMappingTOs=new SchemaMappingTOs();
  SchemaMappingTO schemaMappingTO=null;
  for (int i=0; i < 3; i++) {
    schemaMappingTO=new SchemaMappingTO();
    schemaMappingTO.setField("String_Node_Str" + i);
    schemaMappingTO.setUserSchema("String_Node_Str");
    schemaMappingTO.setRoleSchema("String_Node_Str");
    schemaMappingTOs.addMapping(schemaMappingTO);
  }
  resourceTO.setMappings(schemaMappingTOs);
  ResourceTO actual=restTemplate.postForObject(BASE_URL + "String_Node_Str",resourceTO,ResourceTO.class);
  assertNotNull(actual);
  actual=restTemplate.getForObject(BASE_URL + "String_Node_Str",ResourceTO.class,resourceName);
  assertNotNull(actual);
}
Program: 61363
Project: 61363
Buggy source:
SyncopeConfiguration find(String name);

Fixed version (ground truth):
SyncopeConfiguration find(String name) throws MissingConfKeyException ;
Program: 61364
Project: 61364
Buggy source:
@Override public SyncopeConfiguration find(String name){
  return entityManager.find(SyncopeConfiguration.class,name);
}

Fixed version (ground truth):
@Override public SyncopeConfiguration find(String name) throws MissingConfKeyException {
  SyncopeConfiguration syncopeConfiguration=entityManager.find(SyncopeConfiguration.class,name);
  if (syncopeConfiguration == null) {
    throw new MissingConfKeyException(name);
  }
  return syncopeConfiguration;
}
Program: 61365
Project: 61365
Buggy source:
@Override @Transactional public void delete(String name){
  entityManager.remove(find(name));
}

Fixed version (ground truth):
@Override @Transactional public void delete(String name){
  try {
    entityManager.remove(find(name));
  }
 catch (  MissingConfKeyException e) {
    log.error("String_Node_Str" + name,e);
  }
}
Program: 61366
Project: 61366
Buggy source:
/** 
 * Creates user account.
 * @param a set of account attributes.
 * @return accountid of the account created.
 * @throws ProvisioningException in case of failure.
 */
@Override public String create(final Set<WSAttributeValue> data) throws ProvisioningException {
  String res=null;
  for (  WSAttributeValue value : data) {
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + value.getName() + "String_Node_Str"+ value.getType()+ "String_Node_Str"+ value.isNullable()+ "String_Node_Str"+ value.isKey()+ "String_Node_Str"+ value.isPassword()+ "String_Node_Str"+ value.getValue().toString());
    }
    if (value.isKey())     res=value.getValue().toString();
  }
  return res;
}

Fixed version (ground truth):
/** 
 * Creates user account.
 * @param a set of account attributes.
 * @return accountid of the account created.
 * @throws ProvisioningException in case of failure.
 */
@Override public String create(final Set<WSAttributeValue> data) throws ProvisioningException {
  Set<String> schema=new HashSet<String>();
  Set<WSAttribute> attrs=schema();
  for (  WSAttribute attr : attrs) {
    schema.add(attr.getName());
  }
  String res=null;
  for (  WSAttributeValue value : data) {
    if (!schema.contains(value.getName())) {
      throw new IllegalArgumentException("String_Node_Str" + value.getName());
    }
    if (log.isDebugEnabled()) {
      log.debug("String_Node_Str" + value.getName() + "String_Node_Str"+ value.getType()+ "String_Node_Str"+ value.isNullable()+ "String_Node_Str"+ value.isKey()+ "String_Node_Str"+ value.isPassword()+ "String_Node_Str"+ value.getValue().toString());
    }
    if (value.isKey()) {
      res=value.getValue().toString();
    }
  }
  return res;
}
Program: 61369
Project: 61369
Buggy source:
public <T extends AbstractSchema,K extends AbstractDerivedSchema>T updateSchema(SchemaTO schemaTO,Class<T> reference,Class<K> derivedReference) throws InstantiationException, IllegalAccessException, SyncopeClientCompositeErrorException, UniqueValueException {
  T schema=schemaDAO.find(schemaTO.getName(),reference);
  if (schema != null) {
    schema=populateSchema(schema,schemaTO,derivedReference);
    boolean validationExceptionFound=false;
    AbstractAttribute attribute=null;
    AbstractAttributeValue attributeValue=null;
    for (Iterator<? extends AbstractAttribute> attributeItor=schema.getAttributes().iterator(); attributeItor.hasNext() && !validationExceptionFound; ) {
      attribute=attributeItor.next();
      for (Iterator<? extends AbstractAttributeValue> attributeValueItor=attribute.getAttributeValues().iterator(); attributeValueItor.hasNext() && !validationExceptionFound; ) {
        attributeValue=attributeValueItor.next();
        try {
          schema.getValidator().getValue(attributeValue.getValueAsString(),attributeValue);
        }
 catch (        Exception e) {
          validationExceptionFound=true;
        }
      }
    }
    if (validationExceptionFound) {
      SyncopeClientCompositeErrorException sccee=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
      sccee.addException(new SyncopeClientException(SyncopeClientExceptionType.InvalidSchemaUpdate));
      throw sccee;
    }
    return schema;
  }
  return null;
}

Fixed version (ground truth):
public <T extends AbstractSchema,K extends AbstractDerivedSchema>T updateSchema(SchemaTO schemaTO,Class<T> reference,Class<K> derivedReference) throws InstantiationException, IllegalAccessException, SyncopeClientCompositeErrorException, UniqueValueException {
  T schema=schemaDAO.find(schemaTO.getName(),reference);
  if (schema != null) {
    schema=populateSchema(schema,schemaTO,derivedReference);
    boolean validationExceptionFound=false;
    AbstractAttribute attribute=null;
    AbstractAttributeValue attributeValue=null;
    for (Iterator<? extends AbstractAttribute> attributeItor=schema.getAttributes().iterator(); attributeItor.hasNext() && !validationExceptionFound; ) {
      attribute=attributeItor.next();
      for (Iterator<? extends AbstractAttributeValue> attributeValueItor=attribute.getAttributeValues().iterator(); attributeValueItor.hasNext() && !validationExceptionFound; ) {
        attributeValue=attributeValueItor.next();
        try {
          schema.getValidator().getValue(attributeValue.getValueAsString(),attributeValue);
        }
 catch (        Exception e) {
          validationExceptionFound=true;
        }
      }
    }
    if (validationExceptionFound) {
      SyncopeClientCompositeErrorException sccee=new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST);
      SyncopeClientException ex=new SyncopeClientException(SyncopeClientExceptionType.InvalidUpdate);
      ex.addElement(schema.getName());
      sccee.addException(ex);
      throw sccee;
    }
    return schema;
  }
  return null;
}
Program: 61370
Project: 61370
Buggy source:
public void update(){
  final String resourceName="String_Node_Str";
  ResourceTO resourceTO=new ResourceTO();
  resourceTO.setName(resourceName);
  resourceTO.setConnectorId(101L);
  SchemaMappingTOs schemaMappingTOs=new SchemaMappingTOs();
  SchemaMappingTO schemaMappingTO=null;
  for (int i=3; i < 6; i++) {
    schemaMappingTO=new SchemaMappingTO();
    schemaMappingTO.setField("String_Node_Str" + i);
    schemaMappingTO.setUserSchema("String_Node_Str");
    schemaMappingTO.setRoleSchema("String_Node_Str");
    schemaMappingTOs.addMapping(schemaMappingTO);
  }
  resourceTO.setMappings(schemaMappingTOs);
  ResourceTO actual=restTemplate.postForObject(BASE_URL + "String_Node_Str",resourceTO,ResourceTO.class);
  assertNotNull(actual);
  SchemaMappingTOs mappings=actual.getMappings();
  assertNotNull(mappings);
  assertTrue(mappings.getMappings().size() == 3);
}

Fixed version (ground truth):
@Test public void update(){
  final String resourceName="String_Node_Str";
  ResourceTO resourceTO=new ResourceTO();
  resourceTO.setName(resourceName);
  resourceTO.setConnectorId(101L);
  SchemaMappingTOs schemaMappingTOs=new SchemaMappingTOs();
  SchemaMappingTO schemaMappingTO=null;
  for (int i=3; i < 6; i++) {
    schemaMappingTO=new SchemaMappingTO();
    schemaMappingTO.setField("String_Node_Str" + i);
    schemaMappingTO.setUserSchema("String_Node_Str");
    schemaMappingTO.setRoleSchema("String_Node_Str");
    schemaMappingTOs.addMapping(schemaMappingTO);
  }
  resourceTO.setMappings(schemaMappingTOs);
  ResourceTO actual=restTemplate.postForObject(BASE_URL + "String_Node_Str",resourceTO,ResourceTO.class);
  assertNotNull(actual);
  SchemaMappingTOs mappings=actual.getMappings();
  assertNotNull(mappings);
  assertTrue(mappings.getMappings().size() == 3);
}
Program: 61371
Project: 61371
Buggy source:
@Test public void update(){
  SchemaTO schemaTO=restTemplate.getForObject(BASE_URL + "String_Node_Str",SchemaTO.class);
  assertNotNull(schemaTO);
  schemaTO.setVirtual(true);
  SchemaTO updatedTO=restTemplate.postForObject(BASE_URL + "String_Node_Str",schemaTO,SchemaTO.class);
  assertEquals(schemaTO,updatedTO);
  updatedTO.setType(SchemaType.Date);
  SyncopeClientException syncopeClientException=null;
  try {
    restTemplate.postForObject(BASE_URL + "String_Node_Str",updatedTO,SchemaTO.class);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    syncopeClientException=e.getException(SyncopeClientExceptionType.InvalidSchemaUpdate);
  }
  assertNotNull(syncopeClientException);
}

Fixed version (ground truth):
@Test public void update(){
  SchemaTO schemaTO=restTemplate.getForObject(BASE_URL + "String_Node_Str",SchemaTO.class);
  assertNotNull(schemaTO);
  schemaTO.setVirtual(true);
  SchemaTO updatedTO=restTemplate.postForObject(BASE_URL + "String_Node_Str",schemaTO,SchemaTO.class);
  assertEquals(schemaTO,updatedTO);
  updatedTO.setType(SchemaType.Date);
  SyncopeClientException syncopeClientException=null;
  try {
    restTemplate.postForObject(BASE_URL + "String_Node_Str",updatedTO,SchemaTO.class);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    syncopeClientException=e.getException(SyncopeClientExceptionType.InvalidUpdate);
  }
  assertNotNull(syncopeClientException);
}
Program: 61372
Project: 61372
Buggy source:
public List<ConnectorBundleTO> getBundles(){
  return bundles;
}

Fixed version (ground truth):
public List<ConnectorBundleTO> getBundles(){
  if (this.bundles == null)   this.bundles=new ArrayList<ConnectorBundleTO>();
  return this.bundles;
}
Program: 61373
Project: 61373
Buggy source:
public Set<PropertyTO> getConfiguration(){
  return configuration;
}

Fixed version (ground truth):
public Set<PropertyTO> getConfiguration(){
  if (this.configuration == null)   this.configuration=new HashSet<PropertyTO>();
  return this.configuration;
}
Program: 61374
Project: 61374
Buggy source:
public List<ConnectorInstanceTO> getInstances(){
  return instances;
}

Fixed version (ground truth):
public List<ConnectorInstanceTO> getInstances(){
  if (this.instances == null)   this.instances=new ArrayList<ConnectorInstanceTO>();
  return this.instances;
}
Program: 61375
Project: 61375
Buggy source:
public boolean addInstance(ConnectorInstanceTO instance){
  if (this.instances == null) {
    this.instances=new ArrayList<ConnectorInstanceTO>();
  }
  return this.instances.add(instance);
}

Fixed version (ground truth):
public boolean addInstance(ConnectorInstanceTO instance){
  if (this.instances == null)   this.instances=new ArrayList<ConnectorInstanceTO>();
  return this.instances.add(instance);
}
Program: 61376
Project: 61376
Buggy source:
public boolean addMapping(SchemaMappingTO mapping){
  if (this.mappings == null) {
    this.mappings=new ArrayList<SchemaMappingTO>();
  }
  return this.mappings.add(mapping);
}

Fixed version (ground truth):
public boolean addMapping(SchemaMappingTO mapping){
  if (this.mappings == null)   this.mappings=new ArrayList<SchemaMappingTO>();
  return this.mappings.add(mapping);
}
Program: 61377
Project: 61377
Buggy source:
public List<SchemaMappingTO> getMappings(){
  if (this.mappings == null) {
    this.mappings=new ArrayList<SchemaMappingTO>();
  }
  return this.mappings;
}

Fixed version (ground truth):
public List<SchemaMappingTO> getMappings(){
  if (this.mappings == null)   this.mappings=new ArrayList<SchemaMappingTO>();
  return this.mappings;
}
Program: 61380
Project: 61380
Buggy source:
public boolean removeResource(Resource resource){
  return resources.remove(resource);
}

Fixed version (ground truth):
public boolean removeResource(Resource resource){
  if (this.resources == null)   return true;
  return resources.remove(resource);
}
Program: 61381
Project: 61381
Buggy source:
public boolean addResource(Resource resource){
  return resources.add(resource);
}

Fixed version (ground truth):
public boolean addResource(Resource resource){
  if (this.resources == null)   this.resources=new HashSet<Resource>();
  return this.resources.add(resource);
}
Program: 61382
Project: 61382
Buggy source:
public Set<Resource> getResources(){
  return resources;
}

Fixed version (ground truth):
public Set<Resource> getResources(){
  if (this.resources == null)   this.resources=new HashSet<Resource>();
  return this.resources;
}
Program: 61383
Project: 61383
Buggy source:
public boolean removeRole(SyncopeRole role){
  return roles.remove(role);
}

Fixed version (ground truth):
public boolean removeRole(SyncopeRole role){
  if (this.roles == null)   return true;
  return this.roles.remove(role);
}
Program: 61384
Project: 61384
Buggy source:
public boolean addRole(SyncopeRole role){
  return roles.add(role);
}

Fixed version (ground truth):
public boolean addRole(SyncopeRole role){
  if (this.roles == null)   this.roles=new HashSet<SyncopeRole>();
  return this.roles.add(role);
}
Program: 61385
Project: 61385
Buggy source:
public Set<SyncopeRole> getRoles(){
  return roles;
}

Fixed version (ground truth):
public Set<SyncopeRole> getRoles(){
  if (this.roles == null)   this.roles=new HashSet<SyncopeRole>();
  return this.roles;
}
Program: 61386
Project: 61386
Buggy source:
public abstract <T extends AbstractAttribute>void setAttribute(T attribute) throws ClassCastException ;

Fixed version (ground truth):
public abstract <T extends AbstractAttribute>void setAttribute(T attribute);
Program: 61387
Project: 61387
Buggy source:
public abstract <T extends AbstractAttribute>T getAttribute() throws ClassCastException ;

Fixed version (ground truth):
public abstract <T extends AbstractAttribute>T getAttribute();
Program: 61388
Project: 61388
Buggy source:
@Override public <T extends AbstractSchema>boolean addSchema(T schema){
  if (!(schema instanceof RoleSchema)) {
    throw new ClassCastException();
  }
  return schemas.add((RoleSchema)schema);
}

Fixed version (ground truth):
@Override public <T extends AbstractSchema>boolean addSchema(T schema){
  return schemas.add((RoleSchema)schema);
}
Program: 61389
Project: 61389
Buggy source:
public <T extends AbstractAttributeValue>T getValue(Object value,T attributeValue) throws ValidationException {
  if (!attributeClass.isInstance(value)) {
    throw new ParseException(new ClassCastException("String_Node_Str" + value.getClass().getName() + "String_Node_Str"+ attributeClass.getName()));
  }
  attributeValue=value instanceof String ? parseValue((String)value,attributeValue) : parseValue(value,attributeValue);
  doValidate(attributeValue);
  return attributeValue;
}

Fixed version (ground truth):
public <T extends AbstractAttributeValue>T getValue(Object value,T attributeValue) throws ValidationException {
  if (!attributeClass.isInstance(value)) {
    throw new ParseException(new TypeMismatchException(value,attributeClass));
  }
  attributeValue=value instanceof String ? parseValue((String)value,attributeValue) : parseValue(value,attributeValue);
  doValidate(attributeValue);
  return attributeValue;
}
Program: 61390
Project: 61390
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public List<DerivedSchemaTO> derivedAttributeList(HttpServletRequest request,@PathVariable("String_Node_Str") String kind) throws IOException {
  Class reference=getReference(kind);
  WebApplicationContext webApplicationContext=RequestContextUtils.getWebApplicationContext(request);
  DerivedSchemaDAO derivedAttributeSchemaDAO=(DerivedSchemaDAO)webApplicationContext.getBean("String_Node_Str");
  List<AbstractDerivedSchema> derivedAttributeSchemas=derivedAttributeSchemaDAO.findAll(reference);
  List<DerivedSchemaTO> result=new ArrayList<DerivedSchemaTO>(derivedAttributeSchemas.size());
  DerivedSchemaTO derivedAttributeSchemaTO=null;
  String[] ignoreProperties={"String_Node_Str"};
  for (  AbstractDerivedSchema derivedSchema : derivedAttributeSchemas) {
    derivedAttributeSchemaTO=new DerivedSchemaTO();
    BeanUtils.copyProperties(derivedSchema,derivedAttributeSchemaTO,ignoreProperties);
    for (    AbstractSchema schema : derivedSchema.getSchemas()) {
      derivedAttributeSchemaTO.addSchema(schema.getName());
    }
    result.add(derivedAttributeSchemaTO);
  }
  return result;
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public List<DerivedSchemaTO> derivedAttributeList(HttpServletRequest request,@PathVariable("String_Node_Str") String kind){
  Class reference=getDerivedSchemaReference(kind);
  List<AbstractDerivedSchema> derivedAttributeSchemas=derivedSchemaDAO.findAll(reference);
  List<DerivedSchemaTO> result=new ArrayList<DerivedSchemaTO>(derivedAttributeSchemas.size());
  DerivedSchemaTO derivedAttributeSchemaTO=null;
  String[] ignoreProperties={"String_Node_Str"};
  for (  AbstractDerivedSchema derivedSchema : derivedAttributeSchemas) {
    derivedAttributeSchemaTO=new DerivedSchemaTO();
    BeanUtils.copyProperties(derivedSchema,derivedAttributeSchemaTO,ignoreProperties);
    for (    AbstractSchema schema : derivedSchema.getSchemas()) {
      derivedAttributeSchemaTO.addSchema(schema.getName());
    }
    result.add(derivedAttributeSchemaTO);
  }
  return result;
}
Program: 61391
Project: 61391
Buggy source:
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public List<SchemaTO> attributeList(HttpServletRequest request,@PathVariable("String_Node_Str") String kind) throws IOException {
  Class reference=getReference(kind);
  WebApplicationContext webApplicationContext=RequestContextUtils.getWebApplicationContext(request);
  SchemaDAO schemaDAO=(SchemaDAO)webApplicationContext.getBean("String_Node_Str");
  List<AbstractSchema> schemas=schemaDAO.findAll(reference);
  List<SchemaTO> result=new ArrayList<SchemaTO>(schemas.size());
  SchemaTO schemaTO=null;
  String[] ignoreProperties={"String_Node_Str"};
  for (  AbstractSchema schema : schemas) {
    schemaTO=new SchemaTO();
    BeanUtils.copyProperties(schema,schemaTO,ignoreProperties);
    for (    AbstractDerivedSchema derivedSchema : schema.getDerivedSchemas()) {
      schemaTO.addDerivedSchema(derivedSchema.getName());
    }
    result.add(schemaTO);
  }
  return result;
}

Fixed version (ground truth):
@RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public List<SchemaTO> attributeList(HttpServletRequest request,@PathVariable("String_Node_Str") String kind){
  Class reference=getSchemaReference(kind);
  List<AbstractSchema> schemas=schemaDAO.findAll(reference);
  List<SchemaTO> result=new ArrayList<SchemaTO>(schemas.size());
  SchemaTO schemaTO=null;
  String[] ignoreProperties={"String_Node_Str"};
  for (  AbstractSchema schema : schemas) {
    schemaTO=new SchemaTO();
    BeanUtils.copyProperties(schema,schemaTO,ignoreProperties);
    for (    AbstractDerivedSchema derivedSchema : schema.getDerivedSchemas()) {
      schemaTO.addDerivedSchema(derivedSchema.getName());
    }
    result.add(schemaTO);
  }
  return result;
}
Program: 61392
Project: 61392
Buggy source:
@Test public void derivedAttributeList(){
  List<DerivedSchemaTO> derivedAttributeSchemas=restTemplate.getForObject(BASE_URL + "String_Node_Str",List.class);
  assertNotNull(derivedAttributeSchemas);
}

Fixed version (ground truth):
@Test public void derivedAttributeList(){
  List<DerivedSchemaTO> derivedSchemas=restTemplate.getForObject(BASE_URL + "String_Node_Str",List.class);
  assertNotNull(derivedSchemas);
}
Program: 61393
Project: 61393
Buggy source:
@Test public void attributeList(){
  List<SchemaTO> attributeSchemas=restTemplate.getForObject(BASE_URL + "String_Node_Str",List.class);
  assertNotNull(attributeSchemas);
}

Fixed version (ground truth):
@Test public void attributeList(){
  List<SchemaTO> schemas=restTemplate.getForObject(BASE_URL + "String_Node_Str",List.class);
  assertNotNull(schemas);
}
Program: 61395
Project: 61395
Buggy source:
@Override public Attribute find(long id){
  Attribute result=entityManager.find(Attribute.class,id);
  if (isDeletedOrNotManaged(result))   result=null;
  return result;
}

Fixed version (ground truth):
@Override public Attribute find(long id){
  Attribute result=entityManager.find(Attribute.class,id);
  if (isDeletedOrNotManaged(result)) {
    result=null;
  }
  return result;
}
Program: 61396
Project: 61396
Buggy source:
@Override public AttributeSchema find(String name){
  return entityManager.find(AttributeSchema.class,name);
}

Fixed version (ground truth):
@Override public AttributeSchema find(String name){
  AttributeSchema result=entityManager.find(AttributeSchema.class,name);
  if (isDeletedOrNotManaged(result)) {
    result=null;
  }
  return result;
}
Program: 61397
Project: 61397
Buggy source:
@Override @Transactional public void delete(String name){
  entityManager.remove(find(name));
}

Fixed version (ground truth):
@Override @Transactional public void delete(String name){
  AttributeSchema schema=find(name);
  if (schema == null) {
    return;
  }
  entityManager.remove(schema);
}
Program: 61398
Project: 61398
Buggy source:
@Override public Entitlement find(String name){
  Entitlement result=entityManager.find(Entitlement.class,name);
  if (isDeletedOrNotManaged(result))   result=null;
  return result;
}

Fixed version (ground truth):
@Override public Entitlement find(String name){
  Entitlement result=entityManager.find(Entitlement.class,name);
  if (isDeletedOrNotManaged(result)) {
    result=null;
  }
  return result;
}