Program: 13295
Project: 13295
Buggy source:
/** 
 * Returns the an AcquiredTriggers object which wraps the List of all triggers in the "acquired" state
 * @param instanceId    the ID of the instance that acquired the triggers
 * @return  the WaitingTriggers object
 * @throws JobPersistenceException
 */
private AcquiredTriggers getAcquiredTriggers(String instanceId) throws JobPersistenceException {
  List<Trigger> acquiredTriggers=new ArrayList<Trigger>();
  List<String> acquiredTriggerIds=new ArrayList<String>();
  String repoId=getAcquiredTriggersRepoId();
  String revision=null;
  Map<String,Object> map;
  if (!setAccessor()) {
    throw new JobPersistenceException("String_Node_Str");
  }
  try {
    try {
      map=accessor.getConnection().read(accessor,Requests.newReadRequest(repoId)).getContent().asMap();
    }
 catch (    NotFoundException e) {
      logger.debug("String_Node_Str","String_Node_Str");
      map=null;
    }
    if (map == null) {
      map=new HashMap<String,Object>();
      map.put(instanceId,acquiredTriggerIds);
      map=accessor.getConnection().create(accessor,Requests.newCreateRequest(repoId.substring(0,repoId.lastIndexOf("String_Node_Str")),repoId.substring(repoId.lastIndexOf("String_Node_Str") + 1),new JsonValue(map))).getContent().asMap();
      revision=(String)map.get("String_Node_Str");
    }
 else {
      acquiredTriggerIds=(List<String>)map.get(instanceId);
      revision=(String)map.get("String_Node_Str");
      if (acquiredTriggerIds == null) {
        acquiredTriggerIds=new ArrayList<String>();
        map.put(instanceId,acquiredTriggerIds);
        UpdateRequest r=Requests.newUpdateRequest(repoId,new JsonValue(map));
        r.setRevision(revision);
        JsonValue updatedValue=accessor.getConnection().update(accessor,r).getContent();
        ;
        revision=(String)updatedValue.asMap().get("String_Node_Str");
      }
    }
    for (    String id : acquiredTriggerIds) {
      TriggerWrapper tw=getTriggerWrapper(getGroupFromId(id),getNameFromId(id));
      if (tw == null) {
        logger.warn("String_Node_Str",id);
      }
 else {
        logger.debug("String_Node_Str",new Object[]{tw.getName(),tw.getGroup()});
        acquiredTriggers.add(tw.getTrigger());
      }
    }
    return new AcquiredTriggers(acquiredTriggers,revision);
  }
 catch (  ResourceException e) {
    logger.warn("String_Node_Str",e);
    throw new JobPersistenceException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Returns the an AcquiredTriggers object which wraps the List of all triggers in the "acquired" state
 * @param instanceId    the ID of the instance that acquired the triggers
 * @return  the WaitingTriggers object
 * @throws JobPersistenceException
 */
private AcquiredTriggers getAcquiredTriggers(String instanceId) throws JobPersistenceException {
  List<Trigger> acquiredTriggers=new ArrayList<Trigger>();
  List<String> acquiredTriggerIds=new ArrayList<String>();
  String repoId=getAcquiredTriggersRepoId();
  String revision=null;
  Map<String,Object> map;
  if (!setAccessor()) {
    throw new JobPersistenceException("String_Node_Str");
  }
  try {
    try {
      map=accessor.getConnection().read(accessor,Requests.newReadRequest(repoId)).getContent().asMap();
    }
 catch (    NotFoundException e) {
      logger.debug("String_Node_Str","String_Node_Str");
      map=null;
    }
    if (map == null) {
      map=new HashMap<String,Object>();
      map.put(instanceId,acquiredTriggerIds);
      map=accessor.getConnection().create(accessor,getCreateRequest(repoId,map)).getContent().asMap();
      revision=(String)map.get("String_Node_Str");
    }
 else {
      acquiredTriggerIds=(List<String>)map.get(instanceId);
      revision=(String)map.get("String_Node_Str");
      if (acquiredTriggerIds == null) {
        acquiredTriggerIds=new ArrayList<String>();
        map.put(instanceId,acquiredTriggerIds);
        UpdateRequest r=Requests.newUpdateRequest(repoId,new JsonValue(map));
        r.setRevision(revision);
        JsonValue updatedValue=accessor.getConnection().update(accessor,r).getContent();
        ;
        revision=(String)updatedValue.asMap().get("String_Node_Str");
      }
    }
    for (    String id : acquiredTriggerIds) {
      TriggerWrapper tw=getTriggerWrapper(getGroupFromId(id),getNameFromId(id));
      if (tw == null) {
        logger.warn("String_Node_Str",id);
      }
 else {
        logger.debug("String_Node_Str",new Object[]{tw.getName(),tw.getGroup()});
        acquiredTriggers.add(tw.getTrigger());
      }
    }
    return new AcquiredTriggers(acquiredTriggers,revision);
  }
 catch (  ResourceException e) {
    logger.warn("String_Node_Str",e);
    throw new JobPersistenceException("String_Node_Str",e);
  }
}