nus-yam/ex-repair huggingface dataset:
Program: 60803
Project: 60803
Buggy source:
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTO reactivate(final @PathVariable("String_Node_Str") Long userId) throws NotFoundException, WorkflowException, UnauthorizedRoleException, PropagationException {
  LOG.debug("String_Node_Str" + userId);
  WorkflowResult<Long> updated=wfAdapter.reactivate(userId);
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updated.getResult(),null,null,null,Boolean.TRUE,null);
  propagationManager.execute(tasks);
  notificationManager.createTasks(updated);
  final UserTO savedTO=dataBinder.getUserTO(updated.getResult());
  LOG.debug("String_Node_Str",savedTO);
  return savedTO;
}

Fixed version (ground truth):
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.GET,value="String_Node_Str") public UserTO reactivate(final @PathVariable("String_Node_Str") Long userId) throws NotFoundException, WorkflowException, UnauthorizedRoleException, PropagationException {
  LOG.debug("String_Node_Str" + userId);
  WorkflowResult<Long> updated=wfAdapter.reactivate(userId);
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updated,Boolean.TRUE);
  propagationManager.execute(tasks);
  notificationManager.createTasks(updated);
  final UserTO savedTO=dataBinder.getUserTO(updated.getResult());
  LOG.debug("String_Node_Str",savedTO);
  return savedTO;
}
Program: 60804
Project: 60804
Buggy source:
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO update(@RequestBody final UserMod userMod) throws NotFoundException, PropagationException, UnauthorizedRoleException, WorkflowException {
  LOG.debug("String_Node_Str",userMod);
  WorkflowResult<Map.Entry<Long,PropagationByResource>> updated=wfAdapter.update(userMod);
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updated.getResult().getKey(),userMod.getPassword(),userMod.getVirtualAttributesToBeRemoved(),userMod.getVirtualAttributesToBeUpdated(),null,updated.getResult().getValue());
  propagationManager.execute(tasks);
  notificationManager.createTasks(new WorkflowResult<Long>(updated.getResult().getKey(),updated.getPerformedTasks()));
  final UserTO updatedTO=dataBinder.getUserTO(updated.getResult().getKey());
  LOG.debug("String_Node_Str",updatedTO);
  return updatedTO;
}

Fixed version (ground truth):
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO update(@RequestBody final UserMod userMod) throws NotFoundException, PropagationException, UnauthorizedRoleException, WorkflowException {
  LOG.debug("String_Node_Str",userMod);
  WorkflowResult<Long> updated=wfAdapter.update(userMod);
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updated,userMod.getPassword(),userMod.getVirtualAttributesToBeRemoved(),userMod.getVirtualAttributesToBeUpdated(),null);
  propagationManager.execute(tasks);
  notificationManager.createTasks(updated);
  final UserTO updatedTO=dataBinder.getUserTO(updated.getResult());
  LOG.debug("String_Node_Str",updatedTO);
  return updatedTO;
}
Program: 60805
Project: 60805
Buggy source:
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.DELETE,value="String_Node_Str") public void delete(@PathVariable("String_Node_Str") final Long userId) throws NotFoundException, WorkflowException, PropagationException, UnauthorizedRoleException {
  LOG.debug("String_Node_Str",userId);
  notificationManager.createTasks(new WorkflowResult<Long>(userId,"String_Node_Str"));
  List<PropagationTask> tasks=propagationManager.getDeleteTaskIds(userId);
  propagationManager.execute(tasks);
  wfAdapter.delete(userId);
  LOG.debug("String_Node_Str",userId);
}

Fixed version (ground truth):
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.DELETE,value="String_Node_Str") public void delete(@PathVariable("String_Node_Str") final Long userId) throws NotFoundException, WorkflowException, PropagationException, UnauthorizedRoleException {
  LOG.debug("String_Node_Str",userId);
  notificationManager.createTasks(new WorkflowResult<Long>(userId,null,"String_Node_Str"));
  List<PropagationTask> tasks=propagationManager.getDeleteTaskIds(userId);
  propagationManager.execute(tasks);
  wfAdapter.delete(userId);
  LOG.debug("String_Node_Str",userId);
}
Program: 60806
Project: 60806
Buggy source:
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") @Transactional(rollbackFor={Throwable.class}) public UserTO submitForm(@RequestBody final WorkflowFormTO form) throws NotFoundException, WorkflowException, PropagationException, UnauthorizedRoleException {
  LOG.debug("String_Node_Str",form);
  Long updatedId=wfAdapter.submitForm(form,SecurityContextHolder.getContext().getAuthentication().getName());
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updatedId,null,null,null,Boolean.TRUE,null);
  propagationManager.execute(tasks);
  final UserTO savedTO=dataBinder.getUserTO(updatedId);
  LOG.debug("String_Node_Str",savedTO);
  return savedTO;
}

Fixed version (ground truth):
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") @Transactional(rollbackFor={Throwable.class}) public UserTO submitForm(@RequestBody final WorkflowFormTO form) throws NotFoundException, WorkflowException, PropagationException, UnauthorizedRoleException {
  LOG.debug("String_Node_Str",form);
  WorkflowResult<Map.Entry<Long,String>> updated=wfAdapter.submitForm(form,SecurityContextHolder.getContext().getAuthentication().getName());
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(new WorkflowResult<Long>(updated.getResult().getKey(),updated.getPropByRes(),updated.getPerformedTasks()),updated.getResult().getValue(),null,null,Boolean.TRUE);
  propagationManager.execute(tasks);
  final UserTO savedTO=dataBinder.getUserTO(updated.getResult().getKey());
  LOG.debug("String_Node_Str",savedTO);
  return savedTO;
}
Program: 60807
Project: 60807
Buggy source:
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO activate(@RequestBody final UserTO userTO) throws WorkflowException, NotFoundException, UnauthorizedRoleException, PropagationException {
  WorkflowResult<Long> updated=wfAdapter.activate(userTO.getId(),userTO.getToken());
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updated.getResult(),null,null,null,Boolean.TRUE,null);
  propagationManager.execute(tasks);
  notificationManager.createTasks(updated);
  final UserTO savedTO=dataBinder.getUserTO(updated.getResult());
  LOG.debug("String_Node_Str",savedTO);
  return savedTO;
}

Fixed version (ground truth):
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO activate(@RequestBody final UserTO userTO) throws WorkflowException, NotFoundException, UnauthorizedRoleException, PropagationException {
  WorkflowResult<Long> updated=wfAdapter.activate(userTO.getId(),userTO.getToken());
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updated,Boolean.TRUE);
  propagationManager.execute(tasks);
  notificationManager.createTasks(updated);
  final UserTO savedTO=dataBinder.getUserTO(updated.getResult());
  LOG.debug("String_Node_Str",savedTO);
  return savedTO;
}
Program: 60808
Project: 60808
Buggy source:
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO create(final HttpServletResponse response,@RequestBody final UserTO userTO) throws PropagationException, UnauthorizedRoleException, WorkflowException, NotFoundException {
  LOG.debug("String_Node_Str",userTO);
  Set<Long> requestRoleIds=new HashSet<Long>(userTO.getMemberships().size());
  for (  MembershipTO membership : userTO.getMemberships()) {
    requestRoleIds.add(membership.getRoleId());
  }
  Set<Long> adminRoleIds=EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
  requestRoleIds.removeAll(adminRoleIds);
  if (!requestRoleIds.isEmpty()) {
    throw new UnauthorizedRoleException(requestRoleIds);
  }
  WorkflowResult<Map.Entry<Long,Boolean>> created=wfAdapter.create(userTO);
  List<PropagationTask> tasks=propagationManager.getCreateTaskIds(created.getResult().getKey(),userTO.getPassword(),userTO.getVirtualAttributes(),created.getResult().getValue());
  propagationManager.execute(tasks);
  notificationManager.createTasks(new WorkflowResult<Long>(created.getResult().getKey(),created.getPerformedTasks()));
  final UserTO savedTO=dataBinder.getUserTO(created.getResult().getKey());
  LOG.debug("String_Node_Str",savedTO);
  response.setStatus(HttpServletResponse.SC_CREATED);
  return savedTO;
}

Fixed version (ground truth):
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO create(final HttpServletResponse response,@RequestBody final UserTO userTO) throws PropagationException, UnauthorizedRoleException, WorkflowException, NotFoundException {
  LOG.debug("String_Node_Str",userTO);
  Set<Long> requestRoleIds=new HashSet<Long>(userTO.getMemberships().size());
  for (  MembershipTO membership : userTO.getMemberships()) {
    requestRoleIds.add(membership.getRoleId());
  }
  Set<Long> adminRoleIds=EntitlementUtil.getRoleIds(EntitlementUtil.getOwnedEntitlementNames());
  requestRoleIds.removeAll(adminRoleIds);
  if (!requestRoleIds.isEmpty()) {
    throw new UnauthorizedRoleException(requestRoleIds);
  }
  WorkflowResult<Map.Entry<Long,Boolean>> created=wfAdapter.create(userTO);
  List<PropagationTask> tasks=propagationManager.getCreateTaskIds(created,userTO.getPassword(),userTO.getVirtualAttributes());
  propagationManager.execute(tasks);
  notificationManager.createTasks(new WorkflowResult<Long>(created.getResult().getKey(),created.getPropByRes(),created.getPerformedTasks()));
  final UserTO savedTO=dataBinder.getUserTO(created.getResult().getKey());
  LOG.debug("String_Node_Str",savedTO);
  response.setStatus(HttpServletResponse.SC_CREATED);
  return savedTO;
}
Program: 60809
Project: 60809
Buggy source:
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO executeWorkflow(@RequestBody final UserTO userTO,@PathVariable("String_Node_Str") final String taskId) throws WorkflowException, NotFoundException, UnauthorizedRoleException, PropagationException {
  LOG.debug("String_Node_Str",taskId,userTO.getId());
  WorkflowResult<Long> updated=wfAdapter.execute(userTO,taskId);
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updated.getResult(),null,null,null,null,null);
  propagationManager.execute(tasks);
  notificationManager.createTasks(updated);
  final UserTO savedTO=dataBinder.getUserTO(updated.getResult());
  LOG.debug("String_Node_Str",savedTO);
  return savedTO;
}

Fixed version (ground truth):
@PreAuthorize("String_Node_Str") @RequestMapping(method=RequestMethod.POST,value="String_Node_Str") public UserTO executeWorkflow(@RequestBody final UserTO userTO,@PathVariable("String_Node_Str") final String taskId) throws WorkflowException, NotFoundException, UnauthorizedRoleException, PropagationException {
  LOG.debug("String_Node_Str",taskId,userTO.getId());
  WorkflowResult<Long> updated=wfAdapter.execute(userTO,taskId);
  List<PropagationTask> tasks=propagationManager.getUpdateTaskIds(updated,null);
  propagationManager.execute(tasks);
  notificationManager.createTasks(updated);
  final UserTO savedTO=dataBinder.getUserTO(updated.getResult());
  LOG.debug("String_Node_Str",savedTO);
  return savedTO;
}
Program: 60810
Project: 60810
Buggy source:
private SyncResult createUser(final SyncDelta delta,final boolean dryRun) throws JobExecutionException {
  final SyncResult result=new SyncResult();
  result.setOperation(Operation.CREATE);
  UserTO userTO=getUserTO(delta.getObject());
  actions.beforeCreate(delta,userTO);
  if (dryRun) {
    result.setUserId(0L);
    result.setUsername(userTO.getUsername());
    result.setStatus(SyncResult.Status.SUCCESS);
  }
 else {
    try {
      WorkflowResult<Map.Entry<Long,Boolean>> created=wfAdapter.create(userTO,true);
      List<PropagationTask> tasks=propagationManager.getCreateTaskIds(created.getResult().getKey(),userTO.getPassword(),null,created.getResult().getValue(),((SyncTask)this.task).getResource().getName());
      propagationManager.execute(tasks);
      userTO=userDataBinder.getUserTO(created.getResult().getKey());
      result.setUserId(created.getResult().getKey());
      result.setUsername(userTO.getUsername());
      result.setStatus(SyncResult.Status.SUCCESS);
    }
 catch (    PropagationException e) {
      LOG.error("String_Node_Str" + delta.getUid().getUidValue(),e);
    }
catch (    Throwable t) {
      result.setStatus(SyncResult.Status.FAILURE);
      result.setMessage(t.getMessage());
      LOG.error("String_Node_Str" + delta.getUid().getUidValue(),t);
    }
  }
  actions.after(delta,userTO,result);
  return result;
}

Fixed version (ground truth):
private SyncResult createUser(final SyncDelta delta,final boolean dryRun) throws JobExecutionException {
  final SyncResult result=new SyncResult();
  result.setOperation(Operation.CREATE);
  UserTO userTO=getUserTO(delta.getObject());
  actions.beforeCreate(delta,userTO);
  if (dryRun) {
    result.setUserId(0L);
    result.setUsername(userTO.getUsername());
    result.setStatus(SyncResult.Status.SUCCESS);
  }
 else {
    try {
      WorkflowResult<Map.Entry<Long,Boolean>> created=wfAdapter.create(userTO,true);
      List<PropagationTask> tasks=propagationManager.getCreateTaskIds(created,userTO.getPassword(),null,((SyncTask)this.task).getResource().getName());
      propagationManager.execute(tasks);
      userTO=userDataBinder.getUserTO(created.getResult().getKey());
      result.setUserId(created.getResult().getKey());
      result.setUsername(userTO.getUsername());
      result.setStatus(SyncResult.Status.SUCCESS);
    }
 catch (    PropagationException e) {
      LOG.error("String_Node_Str" + delta.getUid().getUidValue(),e);
    }
catch (    Throwable t) {
      result.setStatus(SyncResult.Status.FAILURE);
      result.setMessage(t.getMessage());
      LOG.error("String_Node_Str" + delta.getUid().getUidValue(),t);
    }
  }
  actions.after(delta,userTO,result);
  return result;
}
Program: 60813
Project: 60813
Buggy source:
public AbstractAttributableMod(){
  super();
  attributesToBeUpdated=new HashSet<AttributeMod>();
  attributesToBeRemoved=new HashSet<String>();
  derivedAttributesToBeAdded=new HashSet<String>();
  derivedAttributesToBeRemoved=new HashSet<String>();
  virtualAttributesToBeAdded=new HashSet<String>();
  virtualAttributesToBeRemoved=new HashSet<String>();
  resourcesToBeAdded=new HashSet<String>();
  resourcesToBeRemoved=new HashSet<String>();
}

Fixed version (ground truth):
public AbstractAttributableMod(){
  super();
  attributesToBeUpdated=new HashSet<AttributeMod>();
  attributesToBeRemoved=new HashSet<String>();
  derivedAttributesToBeAdded=new HashSet<String>();
  derivedAttributesToBeRemoved=new HashSet<String>();
  virtualAttributesToBeUpdated=new HashSet<AttributeMod>();
  virtualAttributesToBeRemoved=new HashSet<String>();
  resourcesToBeAdded=new HashSet<String>();
  resourcesToBeRemoved=new HashSet<String>();
}
Program: 60814
Project: 60814
Buggy source:
public boolean addVirtualAttributeToBeRemoved(String virtualAttribute){
  return virtualAttributesToBeRemoved.add(virtualAttribute);
}

Fixed version (ground truth):
public boolean addVirtualAttributeToBeRemoved(String virtualAttributeToBeRemoved){
  return virtualAttributesToBeRemoved.add(virtualAttributeToBeRemoved);
}
Program: 60815
Project: 60815
Buggy source:
@JsonIgnore public Map<String,List<String>> getVirtualAttributeMap(){
  Map<String,List<String>> result=new HashMap<String,List<String>>(virtualAttributes.size());
  for (  AttributeTO attributeTO : virtualAttributes) {
    result.put(attributeTO.getSchema(),attributeTO.getValues());
  }
  return result;
}

Fixed version (ground truth):
@JsonIgnore public Map<String,AttributeTO> getVirtualAttributeMap(){
  Map<String,AttributeTO> result=new HashMap<String,AttributeTO>(virtualAttributes.size());
  for (  AttributeTO attributeTO : virtualAttributes) {
    result.put(attributeTO.getSchema(),attributeTO);
  }
  return result;
}
Program: 60816
Project: 60816
Buggy source:
@JsonIgnore public Map<String,List<String>> getAttributeMap(){
  Map<String,List<String>> result=new HashMap<String,List<String>>(attributes.size());
  for (  AttributeTO attributeTO : attributes) {
    result.put(attributeTO.getSchema(),attributeTO.getValues());
  }
  return result;
}

Fixed version (ground truth):
@JsonIgnore public Map<String,AttributeTO> getAttributeMap(){
  Map<String,AttributeTO> result=new HashMap<String,AttributeTO>(attributes.size());
  for (  AttributeTO attributeTO : attributes) {
    result.put(attributeTO.getSchema(),attributeTO);
  }
  return result;
}
Program: 60817
Project: 60817
Buggy source:
@JsonIgnore public Map<String,List<String>> getDerivedAttributeMap(){
  Map<String,List<String>> result=new HashMap<String,List<String>>(derivedAttributes.size());
  for (  AttributeTO attributeTO : derivedAttributes) {
    result.put(attributeTO.getSchema(),attributeTO.getValues());
  }
  return result;
}

Fixed version (ground truth):
@JsonIgnore public Map<String,AttributeTO> getDerivedAttributeMap(){
  Map<String,AttributeTO> result=new HashMap<String,AttributeTO>(derivedAttributes.size());
  for (  AttributeTO attributeTO : derivedAttributes) {
    result.put(attributeTO.getSchema(),attributeTO);
  }
  return result;
}
Program: 60818
Project: 60818
Buggy source:
@Override protected void populateItem(final ListItem<ConnConfProperty> item){
  final ConnConfProperty property=item.getModelObject();
  final Label label=new Label("String_Node_Str",property.getSchema().getDisplayName() == null || property.getSchema().getDisplayName().isEmpty() ? property.getSchema().getName() : property.getSchema().getDisplayName());
  item.add(label);
  final FieldPanel field;
  if (GUARDED_STRING.equals(property.getSchema().getType())) {
    field=new AjaxPasswordFieldPanel("String_Node_Str",label.getDefaultModelObjectAsString(),new PropertyModel<String>(property,"String_Node_Str"),true).setRequired(property.getSchema().isRequired()).setTitle(property.getSchema().getHelpMessage());
  }
 else {
    field=new AjaxTextFieldPanel("String_Node_Str",label.getDefaultModelObjectAsString(),new PropertyModel<String>(property,"String_Node_Str"),true).setRequired(property.getSchema().isRequired()).setTitle(property.getSchema().getHelpMessage());
    if (property.getSchema().isRequired()) {
      field.addRequiredLabel();
    }
  }
  item.add(field);
  item.add(new AjaxCheckBoxPanel("String_Node_Str","String_Node_Str",new PropertyModel<Boolean>(property,"String_Node_Str"),true).setTitle("String_Node_Str"));
  connectorTO.getConfiguration().add(property);
}

Fixed version (ground truth):
@Override protected void populateItem(final ListItem<ConnConfProperty> item){
  final ConnConfProperty property=item.getModelObject();
  final Label label=new Label("String_Node_Str",property.getSchema().getDisplayName() == null || property.getSchema().getDisplayName().isEmpty() ? property.getSchema().getName() : property.getSchema().getDisplayName());
  item.add(label);
  final FieldPanel field;
  if (GUARDED_STRING.equals(property.getSchema().getType())) {
    field=new AjaxPasswordFieldPanel("String_Node_Str",label.getDefaultModelObjectAsString(),new PropertyModel<String>(property,"String_Node_Str"),true).setRequired(property.getSchema().isRequired()).setTitle(property.getSchema().getHelpMessage());
  }
 else {
    field=new AjaxTextFieldPanel("String_Node_Str",label.getDefaultModelObjectAsString(),new PropertyModel<String>(property,"String_Node_Str"),true).setRequired(property.getSchema().isRequired()).setTitle(property.getSchema().getHelpMessage());
    if (property.getSchema().isRequired()) {
      field.addRequiredLabel();
    }
  }
  item.add(field);
  final AjaxDropDownChoicePanel<Boolean> overridable=new AjaxDropDownChoicePanel<Boolean>("String_Node_Str","String_Node_Str",new PropertyModel(property,"String_Node_Str"),false);
  overridable.setChoiceRenderer(new OverridableRenderer());
  overridable.setChoices(Arrays.asList(new Boolean[]{ConnParameterType.NOT_OVERRIDABLE.getOverridable(),ConnParameterType.OVERRIDABLE.getOverridable()}));
  overridable.setStyleShet("String_Node_Str");
  overridable.addRequiredLabel();
  item.add(overridable);
  connectorTO.getConfiguration().add(property);
}
Program: 60820
Project: 60820
Buggy source:
@Override public Object getDisplayValue(final ConnBundleTO object){
  return object.getBundleName() + "String_Node_Str" + object.getVersion();
}

Fixed version (ground truth):
@Override public Object getDisplayValue(Boolean object){
  return object ? ConnParameterType.OVERRIDABLE.toString() : ConnParameterType.NOT_OVERRIDABLE.toString();
}
Program: 60821
Project: 60821
Buggy source:
@Override public String getIdValue(final ConnBundleTO object,final int index){
  return object.getBundleName() + "String_Node_Str" + object.getVersion();
}

Fixed version (ground truth):
@Override public String getIdValue(Boolean object,int index){
  return String.valueOf(object);
}
Program: 60822
Project: 60822
Buggy source:
@Override public void populateItem(final Item<ICellPopulator<UserTO>> cellItem,final String componentId,final IModel<UserTO> rowModel){
  final List<String> values;
switch (schemaType) {
case schema:
    values=rowModel.getObject().getAttributeMap().get(name).getValues();
  break;
case virtualSchema:
values=rowModel.getObject().getVirtualAttributeMap().get(name).getValues();
break;
case derivedSchema:
values=rowModel.getObject().getDerivedAttributeMap().get(name).getValues();
break;
default :
values=null;
}
if (values == null || values.isEmpty()) {
cellItem.add(new Label(componentId,"String_Node_Str"));
}
 else {
if (values.size() == 1) {
cellItem.add(new Label(componentId,values.iterator().next()));
}
 else {
cellItem.add(new Label(componentId,values.toString()));
}
}
}

Fixed version (ground truth):
@Override public void populateItem(final Item<ICellPopulator<UserTO>> cellItem,final String componentId,final IModel<UserTO> rowModel){
  List<String> values=null;
switch (schemaType) {
case schema:
    if (rowModel.getObject().getAttributeMap().containsKey(name)) {
      values=rowModel.getObject().getAttributeMap().get(name).getValues();
    }
  break;
case virtualSchema:
if (rowModel.getObject().getVirtualAttributeMap().containsKey(name)) {
  values=rowModel.getObject().getVirtualAttributeMap().get(name).getValues();
}
break;
case derivedSchema:
if (rowModel.getObject().getDerivedAttributeMap().containsKey(name)) {
values=rowModel.getObject().getDerivedAttributeMap().get(name).getValues();
}
break;
default :
}
if (values == null || values.isEmpty()) {
cellItem.add(new Label(componentId,"String_Node_Str"));
}
 else {
if (values.size() == 1) {
cellItem.add(new Label(componentId,values.get(0)));
}
 else {
cellItem.add(new Label(componentId,values.toString()));
}
}
}
Program: 60823
Project: 60823
Buggy source:
public final boolean checkValidity(){
  if (type == null) {
    return false;
  }
switch (type) {
case LEAF:
case NOT_LEAF:
    return (attributeCond != null && membershipCond == null && resourceCond == null && attributeCond.checkValidity()) || (attributeCond == null && membershipCond != null && resourceCond == null && membershipCond.checkValidity()) || (attributeCond == null && membershipCond == null && resourceCond != null && resourceCond.checkValidity());
case AND:
case OR:
  return (leftNodeCond == null || rightNodeCond == null) ? false : leftNodeCond.checkValidity() && rightNodeCond.checkValidity();
default :
return false;
}
}

Fixed version (ground truth):
public final boolean checkValidity(){
  if (type == null) {
    return false;
  }
switch (type) {
case LEAF:
case NOT_LEAF:
    return (syncopeUserCond != null && attributeCond == null && membershipCond == null && resourceCond == null && syncopeUserCond.checkValidity()) || (syncopeUserCond == null && attributeCond != null && membershipCond == null && resourceCond == null && attributeCond.checkValidity()) || (syncopeUserCond == null && attributeCond == null && membershipCond != null && resourceCond == null && membershipCond.checkValidity())|| (syncopeUserCond == null && attributeCond == null && membershipCond == null && resourceCond != null && resourceCond.checkValidity());
case AND:
case OR:
  return (leftNodeCond == null || rightNodeCond == null) ? false : leftNodeCond.checkValidity() && rightNodeCond.checkValidity();
default :
return false;
}
}
Program: 60824
Project: 60824
Buggy source:
public void setResourceCond(ResourceCond resourceCond){
  this.resourceCond=resourceCond;
}

Fixed version (ground truth):
public void setResourceCond(final ResourceCond resourceCond){
  this.resourceCond=resourceCond;
}
Program: 60825
Project: 60825
Buggy source:
public void set(final Request request,final Response response,final String key,final String value){
  Cookie prefCookie=((WebRequest)request).getCookie(Constants.PREFS_COOKIE_NAME);
  if (prefCookie == null) {
    prefCookie=new Cookie(Constants.PREFS_COOKIE_NAME,"String_Node_Str");
  }
  Map<String,String> prefs;
  try {
    prefs=getPrefs(new String(Base64.decodeBase64(prefCookie.getValue().getBytes())));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str" + prefCookie.getValue(),e);
    prefs=new HashMap<String,String>();
  }
  prefs.put(key,value);
  try {
    prefCookie.setValue(new String(Base64.encodeBase64(setPrefs(prefs).getBytes())));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str" + prefs);
  }
  prefCookie.setMaxAge(ONE_YEAR_TIME);
  ((WebResponse)response).addCookie(prefCookie);
}

Fixed version (ground truth):
public void set(final Request request,final Response response,final String key,final String value){
  Cookie prefCookie=((WebRequest)request).getCookie(Constants.PREFS_COOKIE_NAME);
  final Map<String,String> prefs=new HashMap<String,String>();
  if (prefCookie == null || !StringUtils.hasText(prefCookie.getValue())) {
    prefCookie=new Cookie(Constants.PREFS_COOKIE_NAME,null);
  }
 else {
    prefs.putAll(getPrefs(new String(Base64.decodeBase64(prefCookie.getValue().getBytes()))));
  }
  prefs.put(key,value);
  try {
    prefCookie.setValue(new String(Base64.encodeBase64(setPrefs(prefs).getBytes())));
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str" + prefs,e);
  }
  prefCookie.setMaxAge(ONE_YEAR_TIME);
  ((WebResponse)response).addCookie(prefCookie);
}
Program: 60826
Project: 60826
Buggy source:
public List<String> getList(final Request request,final String key){
  List<String> result=new ArrayList<String>();
  String compound=get(request,key);
  if (compound != null) {
    String[] items=compound.split("String_Node_Str");
    if (items != null) {
      result.addAll(Arrays.asList(items));
    }
 else {
      LOG.error("String_Node_Str" + compound);
    }
  }
  return result;
}

Fixed version (ground truth):
public List<String> getList(final Request request,final String key){
  final List<String> result=new ArrayList<String>();
  final String compound=get(request,key);
  if (StringUtils.hasText(compound)) {
    String[] items=compound.split("String_Node_Str");
    result.addAll(Arrays.asList(items));
  }
  return result;
}
Program: 60827
Project: 60827
Buggy source:
private Map<String,String> getPrefs(final String value) throws IOException {
  return mapper.readValue(value,MAP_TYPE_REF);
}

Fixed version (ground truth):
private Map<String,String> getPrefs(final String value){
  HashMap<String,String> prefs;
  try {
    if (StringUtils.hasText(value)) {
      prefs=mapper.readValue(value,MAP_TYPE_REF);
    }
 else {
      throw new Exception("String_Node_Str" + value + "String_Node_Str");
    }
  }
 catch (  Exception e) {
    LOG.debug("String_Node_Str",e);
    prefs=new HashMap<String,String>();
  }
  return prefs;
}
Program: 60828
Project: 60828
Buggy source:
public String get(final Request request,final String key){
  String result=null;
  Cookie prefCookie=((WebRequest)request).getCookie(Constants.PREFS_COOKIE_NAME);
  if (prefCookie != null) {
    Map<String,String> prefs;
    try {
      prefs=getPrefs(new String(Base64.decodeBase64(prefCookie.getValue().getBytes())));
    }
 catch (    IOException e) {
      LOG.error("String_Node_Str",prefCookie.getValue(),e);
      prefs=new HashMap<String,String>();
    }
    result=prefs.get(key);
  }
 else {
    LOG.debug("String_Node_Str",Constants.PREFS_COOKIE_NAME);
  }
  return result;
}

Fixed version (ground truth):
public String get(final Request request,final String key){
  String result=null;
  Cookie prefCookie=((WebRequest)request).getCookie(Constants.PREFS_COOKIE_NAME);
  if (prefCookie != null) {
    final Map<String,String> prefs=getPrefs(new String(Base64.decodeBase64(prefCookie.getValue().getBytes())));
    result=prefs.get(key);
  }
 else {
    LOG.debug("String_Node_Str",Constants.PREFS_COOKIE_NAME);
  }
  return result;
}
Program: 60829
Project: 60829
Buggy source:
public void setList(final Request request,final Response response,final String key,final List<String> values){
  set(request,response,key,StringUtils.join(values.toArray(new String[]{}),"String_Node_Str"));
}

Fixed version (ground truth):
public void setList(final Request request,final Response response,final Map<String,List<String>> prefs){
  set(request,response,prefs);
}
Program: 60830
Project: 60830
Buggy source:
@Override public void onClose(final AjaxRequestTarget target){
  final TreeNodeClickUpdate data=new TreeNodeClickUpdate(target,nodePanel.getSelectedNode());
  send(getPage(),Broadcast.BREADTH,data);
  target.add(container);
  if (modalResult) {
    getSession().info(getString("String_Node_Str"));
    target.add(feedbackPanel);
    modalResult=false;
  }
}

Fixed version (ground truth):
@Override public void onClose(final AjaxRequestTarget target){
  final TreeNodeClickUpdate data=new TreeNodeClickUpdate(target,nodePanel.getSelectedNode() != null ? nodePanel.getSelectedNode().getId() : 0);
  send(getPage(),Broadcast.BREADTH,data);
  target.add(container);
  if (modalResult) {
    getSession().info(getString("String_Node_Str"));
    target.add(feedbackPanel);
    modalResult=false;
  }
}
Program: 60831
Project: 60831
Buggy source:
public Roles(final PageParameters parameters){
  super(parameters);
  add(createRoleWin=new ModalWindow("String_Node_Str"));
  createRoleWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
  createRoleWin.setInitialHeight(WIN_HEIGHT);
  createRoleWin.setInitialWidth(WIN_WIDTH);
  createRoleWin.setCookieName("String_Node_Str");
  container=new WebMarkupContainer("String_Node_Str");
  container.setOutputMarkupId(true);
  add(container);
  final TreeRolePanel treePanel=new TreeRolePanel("String_Node_Str");
  treePanel.setOutputMarkupId(true);
  container.add(treePanel);
  final RoleSummaryPanel nodePanel=new RoleSummaryPanel("String_Node_Str",createRoleWin,Roles.this.getPageReference());
  nodePanel.setOutputMarkupId(true);
  container.add(nodePanel);
  createRoleWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){
    private static final long serialVersionUID=8804221891699487139L;
    @Override public void onClose(    final AjaxRequestTarget target){
      final TreeNodeClickUpdate data=new TreeNodeClickUpdate(target,nodePanel.getSelectedNode());
      send(getPage(),Broadcast.BREADTH,data);
      target.add(container);
      if (modalResult) {
        getSession().info(getString("String_Node_Str"));
        target.add(feedbackPanel);
        modalResult=false;
      }
    }
  }
);
  container.add(createRoleWin);
}

Fixed version (ground truth):
public Roles(final PageParameters parameters){
  super(parameters);
  createRoleWin=new ModalWindow("String_Node_Str");
  createRoleWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
  createRoleWin.setInitialHeight(WIN_HEIGHT);
  createRoleWin.setInitialWidth(WIN_WIDTH);
  createRoleWin.setCookieName("String_Node_Str");
  add(createRoleWin);
  container=new WebMarkupContainer("String_Node_Str");
  container.setOutputMarkupId(true);
  add(container);
  final TreeRolePanel treePanel=new TreeRolePanel("String_Node_Str");
  treePanel.setOutputMarkupId(true);
  container.add(treePanel);
  final RoleSummaryPanel nodePanel=new RoleSummaryPanel("String_Node_Str",createRoleWin,Roles.this.getPageReference());
  nodePanel.setOutputMarkupId(true);
  container.add(nodePanel);
  createRoleWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback(){
    private static final long serialVersionUID=8804221891699487139L;
    @Override public void onClose(    final AjaxRequestTarget target){
      final TreeNodeClickUpdate data=new TreeNodeClickUpdate(target,nodePanel.getSelectedNode() != null ? nodePanel.getSelectedNode().getId() : 0);
      send(getPage(),Broadcast.BREADTH,data);
      target.add(container);
      if (modalResult) {
        getSession().info(getString("String_Node_Str"));
        target.add(feedbackPanel);
        modalResult=false;
      }
    }
  }
);
  container.add(createRoleWin);
}
Program: 60832
Project: 60832
Buggy source:
public TreeNodeClickUpdate(final AjaxRequestTarget target,final RoleTO selectedNode){
  this.target=target;
  this.selectedNode=selectedNode;
}

Fixed version (ground truth):
public TreeNodeClickUpdate(final AjaxRequestTarget target,final Long selectedNodeId){
  this.target=target;
  this.selectedNodeId=selectedNodeId;
}
Program: 60833
Project: 60833
Buggy source:
@Override public void onEvent(final IEvent<?> event){
  super.onEvent(event);
  if (event.getPayload() instanceof TreeNodeClickUpdate) {
    final TreeNodeClickUpdate update=(TreeNodeClickUpdate)event.getPayload();
    setSelectedNode(update.getSelectedNode());
    fragment=new Fragment("String_Node_Str",(this.selectedNode.getId() != 0 ? "String_Node_Str" : "String_Node_Str"),this);
    if (this.selectedNode.getId() != 0) {
      roleTabPanel=new RoleTabPanel("String_Node_Str",this.selectedNode,window,callerPageRef);
      roleTabPanel.setOutputMarkupId(true);
      fragment.addOrReplace(roleTabPanel);
    }
 else {
      actionLink=new TreeActionLinkPanel("String_Node_Str",this.selectedNode.getId(),new CompoundPropertyModel(this.selectedNode),window,callerPageRef);
      actionLink.setOutputMarkupId(true);
      fragment.addOrReplace(actionLink);
    }
    replace(fragment);
    update.getTarget().add(this);
  }
}

Fixed version (ground truth):
@Override public void onEvent(final IEvent<?> event){
  super.onEvent(event);
  if (event.getPayload() instanceof TreeNodeClickUpdate) {
    final TreeNodeClickUpdate update=(TreeNodeClickUpdate)event.getPayload();
    this.selectedNode=restClient.readRole(update.getSelectedNodeId());
    fragment=new Fragment("String_Node_Str",(update.getSelectedNodeId() != 0 ? "String_Node_Str" : "String_Node_Str"),this);
    if (update.getSelectedNodeId() != 0) {
      roleTabPanel=new RoleTabPanel("String_Node_Str",this.selectedNode,window,callerPageRef);
      roleTabPanel.setOutputMarkupId(true);
      fragment.addOrReplace(roleTabPanel);
    }
 else {
      actionLink=new TreeActionLinkPanel("String_Node_Str",update.getSelectedNodeId(),new CompoundPropertyModel(this.selectedNode),window,callerPageRef);
      actionLink.setOutputMarkupId(true);
      fragment.addOrReplace(actionLink);
    }
    replace(fragment);
    update.getTarget().add(this);
  }
}
Program: 60834
Project: 60834
Buggy source:
public RoleSummaryPanel(final String id,final ModalWindow window,final PageReference callerPageRef){
  super(id);
  this.callerPageRef=callerPageRef;
  this.window=window;
  fragment=new Fragment("String_Node_Str",this.selectedNode == null ? "String_Node_Str" : (this.selectedNode.getId() == 0 ? "String_Node_Str" : "String_Node_Str"),this);
  if (this.selectedNode != null) {
    if (this.selectedNode.getId() != 0) {
      roleTabPanel=new RoleTabPanel("String_Node_Str",selectedNode,window,callerPageRef);
      roleTabPanel.setOutputMarkupId(true);
      fragment.add(roleTabPanel);
    }
 else {
      actionLink=new TreeActionLinkPanel("String_Node_Str",this.selectedNode.getId(),new CompoundPropertyModel(this.selectedNode),window,callerPageRef);
      fragment.add(actionLink);
    }
  }
  add(fragment);
}

Fixed version (ground truth):
public RoleSummaryPanel(final String id,final ModalWindow window,final PageReference callerPageRef){
  super(id);
  this.callerPageRef=callerPageRef;
  this.window=window;
  fragment=new Fragment("String_Node_Str",this.selectedNode == null ? "String_Node_Str" : (this.selectedNode.getId() != 0 ? "String_Node_Str" : "String_Node_Str"),this);
  if (this.selectedNode != null) {
    if (this.selectedNode.getId() != 0) {
      roleTabPanel=new RoleTabPanel("String_Node_Str",selectedNode,window,callerPageRef);
      roleTabPanel.setOutputMarkupId(true);
      fragment.add(roleTabPanel);
    }
 else {
      actionLink=new TreeActionLinkPanel("String_Node_Str",this.selectedNode.getId(),new CompoundPropertyModel(this.selectedNode),window,callerPageRef);
      fragment.add(actionLink);
    }
  }
  add(fragment);
}
Program: 60835
Project: 60835
Buggy source:
@Override protected void onNodeLinkClicked(final Object node,final BaseTree tree,final AjaxRequestTarget target){
  DefaultMutableTreeNode treeNode=(DefaultMutableTreeNode)node;
  RoleTO unitObject=(RoleTO)treeNode.getUserObject();
  send(getPage(),Broadcast.BREADTH,new TreeNodeClickUpdate(target,unitObject));
}

Fixed version (ground truth):
@Override protected void onNodeLinkClicked(final Object node,final BaseTree baseTree,final AjaxRequestTarget target){
  DefaultMutableTreeNode treeNode=(DefaultMutableTreeNode)node;
  RoleTO unitObject=(RoleTO)treeNode.getUserObject();
  send(getPage(),Broadcast.BREADTH,new TreeNodeClickUpdate(target,unitObject.getId()));
}
Program: 60836
Project: 60836
Buggy source:
private BaseTree updateTree(){
  tree=new LinkTree("String_Node_Str",roleTreeBuilder.build()){
    private static final long serialVersionUID=-5514696922119256101L;
    @Override protected IModel getNodeTextModel(    final IModel model){
      return new PropertyModel(model,"String_Node_Str");
    }
    @Override protected void onNodeLinkClicked(    final Object node,    final BaseTree tree,    final AjaxRequestTarget target){
      DefaultMutableTreeNode treeNode=(DefaultMutableTreeNode)node;
      RoleTO unitObject=(RoleTO)treeNode.getUserObject();
      send(getPage(),Broadcast.BREADTH,new TreeNodeClickUpdate(target,unitObject));
    }
  }
;
  tree.setOutputMarkupId(true);
  tree.getTreeState().expandAll();
  treeContainer.addOrReplace(tree);
  return tree;
}

Fixed version (ground truth):
private void updateTree(){
  tree=new LinkTree("String_Node_Str",roleTreeBuilder.build()){
    private static final long serialVersionUID=-5514696922119256101L;
    @Override protected IModel getNodeTextModel(    final IModel model){
      return new PropertyModel(model,"String_Node_Str");
    }
    @Override protected void onNodeLinkClicked(    final Object node,    final BaseTree baseTree,    final AjaxRequestTarget target){
      DefaultMutableTreeNode treeNode=(DefaultMutableTreeNode)node;
      RoleTO unitObject=(RoleTO)treeNode.getUserObject();
      send(getPage(),Broadcast.BREADTH,new TreeNodeClickUpdate(target,unitObject.getId()));
    }
  }
;
  tree.setOutputMarkupId(true);
  tree.getTreeState().expandAll();
  treeContainer.addOrReplace(tree);
}
Program: 60837
Project: 60837
Buggy source:
private List<SyncopeUser> doSearch(final Set<Long> adminRoles,final NodeCond nodeCond,final int page,final int itemsPerPage){
  Map<Integer,Object> parameters=Collections.synchronizedMap(new HashMap<Integer,Object>());
  StringBuilder queryString=getQuery(nodeCond,parameters);
  queryString.insert(0,"String_Node_Str");
  queryString.append("String_Node_Str");
  queryString.append(getAdminRolesFilter(adminRoles)).append("String_Node_Str");
  Query query=entityManager.createNativeQuery(queryString.toString());
  query.setFirstResult(itemsPerPage * (page <= 0 ? 0 : page - 1));
  if (itemsPerPage >= 0) {
    query.setMaxResults(itemsPerPage);
  }
  fillWithParameters(query,parameters);
  LOG.debug("String_Node_Str",queryString.toString(),parameters);
  Set<Number> userIds=new HashSet<Number>();
  List resultList=query.getResultList();
  if (resultList != null) {
    for (    Object userId : resultList) {
      if (userId instanceof Object[]) {
        userIds.add((Number)((Object[])userId)[0]);
      }
 else {
        userIds.add((Number)userId);
      }
    }
  }
  List<SyncopeUser> result=new ArrayList<SyncopeUser>(userIds.size());
  SyncopeUser user;
  for (  Object userId : userIds) {
    user=userDAO.find(((Number)userId).longValue());
    if (user == null) {
      LOG.error("String_Node_Str" + "String_Node_Str",userId);
    }
 else {
      result.add(user);
    }
  }
  return result;
}

Fixed version (ground truth):
private List<SyncopeUser> doSearch(final Set<Long> adminRoles,final NodeCond nodeCond,final int page,final int itemsPerPage){
  Map<Integer,Object> parameters=Collections.synchronizedMap(new HashMap<Integer,Object>());
  final StringBuilder queryString=getQuery(nodeCond,parameters);
  queryString.insert(0,"String_Node_Str");
  queryString.append("String_Node_Str");
  queryString.append(getAdminRolesFilter(adminRoles)).append("String_Node_Str");
  final Query query=entityManager.createNativeQuery(queryString.toString());
  query.setFirstResult(itemsPerPage * (page <= 0 ? 0 : page - 1));
  if (itemsPerPage >= 0) {
    query.setMaxResults(itemsPerPage);
  }
  fillWithParameters(query,parameters);
  LOG.debug("String_Node_Str",queryString.toString(),parameters);
  final Set<Number> userIds=new HashSet<Number>();
  final List resultList=query.getResultList();
  if (resultList != null) {
    for (    Object userId : resultList) {
      if (userId instanceof Object[]) {
        userIds.add((Number)((Object[])userId)[0]);
      }
 else {
        userIds.add((Number)userId);
      }
    }
  }
  final List<SyncopeUser> result=new ArrayList<SyncopeUser>(userIds.size());
  SyncopeUser user;
  for (  Object userId : userIds) {
    user=userDAO.find(((Number)userId).longValue());
    if (user == null) {
      LOG.error("String_Node_Str" + "String_Node_Str",userId);
    }
 else {
      result.add(user);
    }
  }
  return result;
}
Program: 60838
Project: 60838
Buggy source:
@Test public final void searchByMembership(){
  MembershipCond membershipCond=new MembershipCond();
  membershipCond.setRoleId(1L);
  List<SyncopeUser> users=searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),NodeCond.getLeafCond(membershipCond));
  assertNotNull(users);
  assertEquals(2,users.size());
  membershipCond=new MembershipCond();
  membershipCond.setRoleId(5L);
  users=searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),NodeCond.getNotLeafCond(membershipCond));
  assertNotNull(users);
  assertEquals(3,users.size());
}

Fixed version (ground truth):
@Test public final void searchByMembership(){
  MembershipCond membershipCond=new MembershipCond();
  membershipCond.setRoleId(1L);
  List<SyncopeUser> users=searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),NodeCond.getLeafCond(membershipCond));
  assertNotNull(users);
  assertEquals(2,users.size());
  membershipCond=new MembershipCond();
  membershipCond.setRoleId(5L);
  users=searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),NodeCond.getNotLeafCond(membershipCond));
  assertNotNull(users);
  assertEquals(4,users.size());
}
Program: 60839
Project: 60839
Buggy source:
private String encodePassword(final String password,final CipherAlgorithm cipherAlgoritm) throws NoSuchAlgorithmException, IllegalBlockSizeException, InvalidKeyException, BadPaddingException, NoSuchPaddingException, UnsupportedEncodingException {
  String encodedPassword=null;
  if (password != null) {
    if (cipherAlgoritm == null || cipherAlgoritm == CipherAlgorithm.AES) {
      final byte[] cleartext=password.getBytes("String_Node_Str");
      final Cipher cipher=Cipher.getInstance(CipherAlgorithm.AES.getAlgorithm());
      cipher.init(Cipher.ENCRYPT_MODE,keySpec);
      byte[] encoded=cipher.doFinal(cleartext);
      encodedPassword=new String(Base64.encode(encoded));
    }
 else {
      MessageDigest algorithm=MessageDigest.getInstance(cipherAlgoritm.getAlgorithm());
      algorithm.reset();
      algorithm.update(password.getBytes());
      byte messageDigest[]=algorithm.digest();
      StringBuilder hexString=new StringBuilder();
      for (int i=0; i < messageDigest.length; i++) {
        hexString.append(Integer.toHexString(0xFF & messageDigest[i]));
      }
      encodedPassword=hexString.toString();
    }
  }
  return encodedPassword;
}

Fixed version (ground truth):
private String encodePassword(final String password,final CipherAlgorithm cipherAlgoritm) throws NoSuchAlgorithmException, IllegalBlockSizeException, InvalidKeyException, BadPaddingException, NoSuchPaddingException, UnsupportedEncodingException {
  String encodedPassword=null;
  if (password != null) {
    if (cipherAlgoritm == null || cipherAlgoritm == CipherAlgorithm.AES) {
      final byte[] cleartext=password.getBytes("String_Node_Str");
      final Cipher cipher=Cipher.getInstance(CipherAlgorithm.AES.getAlgorithm());
      cipher.init(Cipher.ENCRYPT_MODE,keySpec);
      byte[] encoded=cipher.doFinal(cleartext);
      encodedPassword=new String(Base64.encode(encoded));
    }
 else {
      MessageDigest algorithm=MessageDigest.getInstance(cipherAlgoritm.getAlgorithm());
      algorithm.reset();
      algorithm.update(password.getBytes());
      byte[] messageDigest=algorithm.digest();
      StringBuilder hexString=new StringBuilder();
      for (int i=0; i < messageDigest.length; i++) {
        String hex=Integer.toHexString(0xff & messageDigest[i]);
        if (hex.length() == 1) {
          hexString.append('0');
        }
        hexString.append(hex);
      }
      encodedPassword=hexString.toString();
    }
  }
  return encodedPassword;
}
Program: 60841
Project: 60841
Buggy source:
@Override protected void onSubmit(final AjaxRequestTarget target,final Form form){
  final UserTO userTO=(UserTO)form.getModelObject();
  try {
    if (userTO.getId() == 0) {
      userRestClient.create(userTO);
    }
 else {
      setupUserMod(userTO);
      if (userMod != null) {
        userRestClient.update(userMod);
      }
    }
    ((Users)callerPageRef.getPage()).setModalResult(true);
    ((Users)callerPageRef.getPage()).getPageParameters().set(Constants.PAGEPARAM_CREATE,userTO.getId() == 0);
    window.close(target);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    LOG.error("String_Node_Str",e);
    error(getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
    target.add(feedbackPanel);
  }
}

Fixed version (ground truth):
@Override protected void onSubmit(final AjaxRequestTarget target,final Form form){
  final UserTO userTO=(UserTO)form.getModelObject();
  try {
    if (userTO.getId() == 0) {
      userRestClient.create(userTO);
    }
 else {
      setupUserMod(userTO);
      if (userMod != null) {
        userRestClient.update(userMod);
      }
    }
    ((Users)callerPageRef.getPage()).setModalResult(true);
    window.close(target);
  }
 catch (  SyncopeClientCompositeErrorException e) {
    LOG.error("String_Node_Str",e);
    error(getString("String_Node_Str") + "String_Node_Str" + e.getMessage());
    target.add(feedbackPanel);
  }
}