Program: 13296
Project: 13296
Buggy source:
/** 
 * Returns the a WaitingTriggers object which wraps the Tree of all triggers in the "waiting" state
 * @return  the WaitingTriggers object
 * @throws JobPersistenceException
 */
private WaitingTriggers getWaitingTriggers() throws JobPersistenceException {
  TreeSet<Trigger> waitingTriggers=new TreeSet(new TriggerComparator());
  List<String> waitingTriggersRepoList=null;
  String repoId=getWaitingTriggersRepoId();
  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>();
      waitingTriggersRepoList=new ArrayList<String>();
      map.put("String_Node_Str",waitingTriggersRepoList);
      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 {
      waitingTriggersRepoList=(List<String>)map.get("String_Node_Str");
      revision=(String)map.get("String_Node_Str");
      if (waitingTriggersRepoList == null) {
        waitingTriggersRepoList=new ArrayList<String>();
        map.put("String_Node_Str",waitingTriggersRepoList);
        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 : waitingTriggersRepoList) {
      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()});
        waitingTriggers.add(tw.getTrigger());
      }
    }
    return new WaitingTriggers(waitingTriggers,revision);
  }
 catch (  ResourceException e) {
    logger.warn("String_Node_Str",e);
    throw new JobPersistenceException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Returns the a WaitingTriggers object which wraps the Tree of all triggers in the "waiting" state
 * @return  the WaitingTriggers object
 * @throws JobPersistenceException
 */
private WaitingTriggers getWaitingTriggers() throws JobPersistenceException {
  TreeSet<Trigger> waitingTriggers=new TreeSet(new TriggerComparator());
  List<String> waitingTriggersRepoList=null;
  String repoId=getWaitingTriggersRepoId();
  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>();
      waitingTriggersRepoList=new ArrayList<String>();
      map.put("String_Node_Str",waitingTriggersRepoList);
      map=accessor.getConnection().create(accessor,getCreateRequest(repoId,map)).getContent().asMap();
      revision=(String)map.get("String_Node_Str");
    }
 else {
      waitingTriggersRepoList=(List<String>)map.get("String_Node_Str");
      revision=(String)map.get("String_Node_Str");
      if (waitingTriggersRepoList == null) {
        waitingTriggersRepoList=new ArrayList<String>();
        map.put("String_Node_Str",waitingTriggersRepoList);
        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 : waitingTriggersRepoList) {
      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()});
        waitingTriggers.add(tw.getTrigger());
      }
    }
    return new WaitingTriggers(waitingTriggers,revision);
  }
 catch (  ResourceException e) {
    logger.warn("String_Node_Str",e);
    throw new JobPersistenceException("String_Node_Str",e);
  }
}