Program: 60911
Project: 60911
Buggy source:
/** 
 * Implementation of the provisioning feature.
 * @param user user to be provisioned
 * @param password cleartext password to be provisioned
 * @param propByRes operation to be performed per resource
 * @param mandResNames resources for mandatory propagation
 * @throws PropagationException if anything goes wrong
 */
protected void provision(final SyncopeUser user,final String password,final PropagationByResource propByRes,final Set<String> mandResNames) throws PropagationException {
  LOG.debug("String_Node_Str",user,propByRes);
  propByRes.purge();
  LOG.debug("String_Node_Str",propByRes);
  ExternalResource resource;
  Map.Entry<String,Set<Attribute>> preparedAttrs;
  PropagationTask task;
  TaskExec execution;
  for (  PropagationOperation type : PropagationOperation.values()) {
    for (    String resourceName : propByRes.get(type)) {
      resource=resourceDAO.find(resourceName);
      preparedAttrs=prepareAttributes(user,password,resource);
      task=new PropagationTask();
      task.setResource(resource);
      task.setResourceOperationType(type);
      task.setPropagationMode(mandResNames.contains(resource.getName()) ? PropagationMode.SYNC : resource.getOptionalPropagationMode());
      task.setAccountId(preparedAttrs.getKey());
      task.setOldAccountId(propByRes.getOldAccountId(resource.getName()));
      task.setAttributes(preparedAttrs.getValue());
      LOG.debug("String_Node_Str",task);
      execution=propagate(task,new Date());
      LOG.debug("String_Node_Str",task,execution);
      if (mandResNames.contains(resource.getName()) && !PropagationTaskExecStatus.SUCCESS.toString().equals(execution.getStatus())) {
        throw new PropagationException(resource.getName(),execution.getMessage());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Implementation of the provisioning feature.
 * @param user user to be provisioned
 * @param password cleartext password to be provisioned
 * @param enable wether user must be enabled or not
 * @param propByRes operation to be performed per resource
 * @param mandResNames resources for mandatory propagation
 * @throws PropagationException if anything goes wrong
 */
protected void provision(final SyncopeUser user,final String password,final Boolean enable,final PropagationByResource propByRes,final Set<String> mandResNames) throws PropagationException {
  LOG.debug("String_Node_Str",user,propByRes);
  propByRes.purge();
  LOG.debug("String_Node_Str",propByRes);
  ExternalResource resource;
  Map.Entry<String,Set<Attribute>> preparedAttrs;
  PropagationTask task;
  TaskExec execution;
  for (  PropagationOperation type : PropagationOperation.values()) {
    for (    String resourceName : propByRes.get(type)) {
      resource=resourceDAO.find(resourceName);
      preparedAttrs=prepareAttributes(user,password,enable,resource);
      task=new PropagationTask();
      task.setResource(resource);
      task.setResourceOperationType(type);
      task.setPropagationMode(mandResNames.contains(resource.getName()) ? PropagationMode.SYNC : resource.getOptionalPropagationMode());
      task.setAccountId(preparedAttrs.getKey());
      task.setOldAccountId(propByRes.getOldAccountId(resource.getName()));
      task.setAttributes(preparedAttrs.getValue());
      LOG.debug("String_Node_Str",task);
      execution=propagate(task,new Date());
      LOG.debug("String_Node_Str",task,execution);
      if (mandResNames.contains(resource.getName()) && !PropagationTaskExecStatus.SUCCESS.toString().equals(execution.getStatus())) {
        throw new PropagationException(resource.getName(),execution.getMessage());
      }
    }
  }
}