Program: 60614
Project: 60614
Buggy source:
protected List<SyncResult> create(SyncDelta delta,final AttributableUtil attrUtil,final boolean dryRun) throws JobExecutionException {
  if (!syncTask.isPerformCreate()) {
    LOG.debug("String_Node_Str");
    return Collections.EMPTY_LIST;
  }
  final SyncResult result=new SyncResult();
  result.setOperation(SyncResult.Operation.CREATE);
  AbstractAttributableTO subjectTO=connObjectUtil.getAttributableTO(delta.getObject(),syncTask,attrUtil);
  delta=actions.beforeCreate(delta,subjectTO);
  if (dryRun) {
    result.setId(0L);
    if (subjectTO instanceof UserTO) {
      result.setName(((UserTO)subjectTO).getUsername());
    }
    if (subjectTO instanceof RoleTO) {
      result.setName(((RoleTO)subjectTO).getName());
    }
    result.setStatus(AbstractTaskJob.Status.SUCCESS);
  }
 else {
    try {
      if (AttributableType.USER == attrUtil.getType()) {
        Boolean enabled=null;
        if (syncTask.isSyncStatus()) {
          Attribute status=AttributeUtil.find(OperationalAttributes.ENABLE_NAME,delta.getObject().getAttributes());
          if (status != null && status.getValue() != null && !status.getValue().isEmpty()) {
            enabled=(Boolean)status.getValue().get(0);
          }
        }
        WorkflowResult<Map.Entry<Long,Boolean>> created=uwfAdapter.create((UserTO)subjectTO,true,enabled);
        List<PropagationTask> tasks=propagationManager.getUserCreateTaskIds(created,((UserTO)subjectTO).getPassword(),subjectTO.getVirtualAttributes(),Collections.singleton(syncTask.getResource().getName()));
        taskExecutor.execute(tasks);
        notificationManager.createTasks(created.getResult().getKey(),created.getPerformedTasks());
        subjectTO=userDataBinder.getUserTO(created.getResult().getKey());
        result.setId(created.getResult().getKey());
      }
      if (AttributableType.ROLE == attrUtil.getType()) {
        WorkflowResult<Long> created=rwfAdapter.create((RoleTO)subjectTO);
        List<PropagationTask> tasks=propagationManager.getRoleCreateTaskIds(created,subjectTO.getVirtualAttributes(),Collections.singleton(syncTask.getResource().getName()));
        taskExecutor.execute(tasks);
        subjectTO=roleDataBinder.getRoleTO(created.getResult());
        result.setId(created.getResult());
      }
      if (subjectTO instanceof UserTO) {
        result.setName(((UserTO)subjectTO).getUsername());
      }
      if (subjectTO instanceof RoleTO) {
        result.setName(((RoleTO)subjectTO).getName());
      }
      result.setStatus(AbstractTaskJob.Status.SUCCESS);
    }
 catch (    PropagationException e) {
      LOG.error("String_Node_Str",attrUtil.getType(),delta.getUid().getUidValue(),e);
    }
catch (    Exception e) {
      result.setStatus(AbstractTaskJob.Status.FAILURE);
      result.setMessage(e.getMessage());
      LOG.error("String_Node_Str",attrUtil.getType(),delta.getUid().getUidValue(),e);
    }
  }
  actions.after(delta,subjectTO,result);
  return Collections.singletonList(result);
}

Fixed version (ground truth):
protected List<SyncResult> create(SyncDelta delta,final AttributableUtil attrUtil,final boolean dryRun) throws JobExecutionException {
  if (!syncTask.isPerformCreate()) {
    LOG.debug("String_Node_Str");
    return Collections.EMPTY_LIST;
  }
  final SyncResult result=new SyncResult();
  result.setOperation(SyncResult.Operation.CREATE);
  AbstractAttributableTO subjectTO=connObjectUtil.getAttributableTO(delta.getObject(),syncTask,attrUtil);
  delta=actions.beforeCreate(delta,subjectTO);
  if (dryRun) {
    result.setId(0L);
    if (subjectTO instanceof UserTO) {
      result.setName(((UserTO)subjectTO).getUsername());
    }
    if (subjectTO instanceof RoleTO) {
      result.setName(((RoleTO)subjectTO).getName());
    }
    result.setStatus(AbstractTaskJob.Status.SUCCESS);
  }
 else {
    try {
      if (AttributableType.USER == attrUtil.getType()) {
        Boolean enabled=null;
        if (syncTask.isSyncStatus()) {
          Attribute status=AttributeUtil.find(OperationalAttributes.ENABLE_NAME,delta.getObject().getAttributes());
          if (status != null && status.getValue() != null && !status.getValue().isEmpty()) {
            enabled=(Boolean)status.getValue().get(0);
          }
        }
        WorkflowResult<Map.Entry<Long,Boolean>> created=uwfAdapter.create((UserTO)subjectTO,true,enabled);
        List<PropagationTask> tasks=propagationManager.getUserCreateTaskIds(created,((UserTO)subjectTO).getPassword(),subjectTO.getVirtualAttributes(),Collections.singleton(syncTask.getResource().getName()));
        taskExecutor.execute(tasks);
        notificationManager.createTasks(created.getResult().getKey(),created.getPerformedTasks());
        subjectTO=userDataBinder.getUserTO(created.getResult().getKey());
        result.setId(created.getResult().getKey());
      }
      if (AttributableType.ROLE == attrUtil.getType()) {
        WorkflowResult<Long> created=rwfAdapter.create((RoleTO)subjectTO);
        EntitlementUtil.extendAuthContext(created.getResult());
        List<PropagationTask> tasks=propagationManager.getRoleCreateTaskIds(created,subjectTO.getVirtualAttributes(),Collections.singleton(syncTask.getResource().getName()));
        taskExecutor.execute(tasks);
        subjectTO=roleDataBinder.getRoleTO(created.getResult());
        result.setId(created.getResult());
      }
      if (subjectTO instanceof UserTO) {
        result.setName(((UserTO)subjectTO).getUsername());
      }
      if (subjectTO instanceof RoleTO) {
        result.setName(((RoleTO)subjectTO).getName());
      }
      result.setStatus(AbstractTaskJob.Status.SUCCESS);
    }
 catch (    PropagationException e) {
      LOG.error("String_Node_Str",attrUtil.getType(),delta.getUid().getUidValue(),e);
    }
catch (    Exception e) {
      result.setStatus(AbstractTaskJob.Status.FAILURE);
      result.setMessage(e.getMessage());
      LOG.error("String_Node_Str",attrUtil.getType(),delta.getUid().getUidValue(),e);
    }
  }
  actions.after(delta,subjectTO,result);
  return Collections.singletonList(result);
}