Program: 13298
Project: 13298
Buggy source:
@Override public void storeTrigger(SchedulingContext context,Trigger trigger,boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException {
synchronized (lock) {
    if (!setAccessor()) {
      throw new JobPersistenceException("String_Node_Str");
    }
    String triggerName=trigger.getKey().getName();
    String groupName=trigger.getKey().getGroup();
    String triggerId=getTriggersRepoId(groupName,triggerName);
    TriggerGroupWrapper tgw=null;
    try {
      tgw=getOrCreateTriggerGroupWrapper(groupName);
    }
 catch (    ResourceException e) {
      logger.warn("String_Node_Str",e);
      throw new JobPersistenceException("String_Node_Str" + "String_Node_Str",e);
    }
    List<String> triggerNames=tgw.getTriggerNames();
    TriggerWrapper tw;
    try {
      tw=new TriggerWrapper(trigger,tgw.isPaused());
    }
 catch (    Exception e) {
      logger.warn("String_Node_Str",e);
      throw new JobPersistenceException("String_Node_Str" + "String_Node_Str",e);
    }
    if (triggerNames.contains(triggerName) && !replaceExisting) {
      throw new ObjectAlreadyExistsException(trigger);
    }
    try {
      if (triggerNames.contains(triggerName)) {
        TriggerWrapper oldTw=getTriggerWrapper(groupName,triggerName);
        logger.debug("String_Node_Str",triggerId);
        UpdateRequest r=Requests.newUpdateRequest(triggerId,tw.getValue());
        r.setRevision(oldTw.getRevision());
        accessor.getConnection().update(accessor,r);
      }
 else {
        tgw.addTrigger(triggerName);
        UpdateRequest r=Requests.newUpdateRequest(getTriggerGroupsRepoId(groupName),tgw.getValue());
        r.setRevision(tgw.getRevision());
        accessor.getConnection().update(accessor,r);
        logger.debug("String_Node_Str",triggerId);
        accessor.getConnection().create(accessor,Requests.newCreateRequest(triggerId,tw.getValue()));
      }
    }
 catch (    ResourceException e) {
      logger.warn("String_Node_Str",e);
      throw new JobPersistenceException("String_Node_Str" + "String_Node_Str",e);
    }
    logger.debug("String_Node_Str",trigger.getName());
    addWaitingTrigger(trigger);
  }
}

Fixed version (ground truth):
@Override public void storeTrigger(SchedulingContext context,Trigger trigger,boolean replaceExisting) throws ObjectAlreadyExistsException, JobPersistenceException {
synchronized (lock) {
    if (!setAccessor()) {
      throw new JobPersistenceException("String_Node_Str");
    }
    String triggerName=trigger.getKey().getName();
    String groupName=trigger.getKey().getGroup();
    String triggerId=getTriggersRepoId(groupName,triggerName);
    TriggerGroupWrapper tgw=null;
    try {
      tgw=getOrCreateTriggerGroupWrapper(groupName);
    }
 catch (    ResourceException e) {
      logger.warn("String_Node_Str",e);
      throw new JobPersistenceException("String_Node_Str" + "String_Node_Str",e);
    }
    List<String> triggerNames=tgw.getTriggerNames();
    TriggerWrapper tw;
    try {
      tw=new TriggerWrapper(trigger,tgw.isPaused());
    }
 catch (    Exception e) {
      logger.warn("String_Node_Str",e);
      throw new JobPersistenceException("String_Node_Str" + "String_Node_Str",e);
    }
    if (triggerNames.contains(triggerName) && !replaceExisting) {
      throw new ObjectAlreadyExistsException(trigger);
    }
    try {
      if (triggerNames.contains(triggerName)) {
        TriggerWrapper oldTw=getTriggerWrapper(groupName,triggerName);
        logger.debug("String_Node_Str",triggerId);
        UpdateRequest r=Requests.newUpdateRequest(triggerId,tw.getValue());
        r.setRevision(oldTw.getRevision());
        accessor.getConnection().update(accessor,r);
      }
 else {
        tgw.addTrigger(triggerName);
        UpdateRequest r=Requests.newUpdateRequest(getTriggerGroupsRepoId(groupName),tgw.getValue());
        r.setRevision(tgw.getRevision());
        accessor.getConnection().update(accessor,r);
        logger.debug("String_Node_Str",triggerId);
        accessor.getConnection().create(accessor,getCreateRequest(triggerId,tw.getValue().asMap()));
      }
    }
 catch (    ResourceException e) {
      logger.warn("String_Node_Str",e);
      throw new JobPersistenceException("String_Node_Str" + "String_Node_Str",e);
    }
    logger.debug("String_Node_Str",trigger.getName());
    addWaitingTrigger(trigger);
  }
}