Program: 6891
Project: 6891
Buggy source:
@Override public void doRun() throws Exception {
  log.debug(this + "String_Node_Str");
  while (true) {
    if (refreshContext) {
      log.debug(this + "String_Node_Str");
      context=http.newPreemptiveContext(new HttpHost(midasAuthScope.getHost(),midasAuthScope.getPort()));
      refreshContext=false;
    }
    Request r;
    Params p;
synchronized (MidasClientService.this) {
      if (requests.size() == 0) {
        runningTasks--;
        log.debug(this + "String_Node_Str");
        fetchTasks.remove(taskId);
        return;
      }
      r=requests.removeFirst();
      p=r.getNextParams();
      if (p == null)       continue;
      if (r.remaining() > 0) {
        if (fetchOrder == RequestFetchOrder.Serial)         requests.addFirst(r);
 else         requests.addLast(r);
      }
    }
    log.debug(this + "String_Node_Str" + p.op+ "String_Node_Str"+ p.url);
    try {
switch (p.op) {
case Get:
        HttpContext c=context;
      if (p.username != null)       c=http.newPreemptiveContext(new HttpHost(midasAuthScope.getHost(),midasAuthScope.getPort()));
    getFromUrl(c,p.resultBldr,p.url,p.username,p.password);
  break;
case Put:
putToUrl(context,p.sendMsg,p.url,p.resultBldr);
break;
case Delete:
deleteAtUrl(context,p.url);
break;
}
log.debug(this + "String_Node_Str" + p.op+ "String_Node_Str"+ p.url);
if (p.resultBldr == null) r.success(null);
 else r.success(p.resultBldr.build());
}
 catch (Exception e) {
log.debug(this + "String_Node_Str" + shortClassName(e.getClass())+ "String_Node_Str"+ p.op+ "String_Node_Str"+ p.url+ "String_Node_Str"+ e.getMessage());
r.error(p,e);
}
}
}

Fixed version (ground truth):
@Override public void doRun() throws Exception {
  log.debug(this + "String_Node_Str");
  while (true) {
    if (refreshContext) {
      log.debug(this + "String_Node_Str");
      context=http.newPreemptiveContext(new HttpHost(midasAuthScope.getHost(),midasAuthScope.getPort()));
      refreshContext=false;
    }
    Request r;
    Params p;
synchronized (MidasClientService.this) {
      if (requests.size() == 0) {
        runningTasks--;
        log.debug(this + "String_Node_Str");
        fetchTasks.remove(taskId);
        return;
      }
      r=requests.removeFirst();
      p=r.getNextParams();
      if (p == null)       continue;
      if (r.remaining() > 0) {
        if (fetchOrder == RequestFetchOrder.Serial)         requests.addFirst(r);
 else         requests.addLast(r);
      }
    }
    log.debug(this + "String_Node_Str" + p.op+ "String_Node_Str"+ p.url);
    try {
switch (p.op) {
case Get:
        HttpContext c=context;
      if (p.username != null)       c=http.newPreemptiveContext(new HttpHost(midasAuthScope.getHost(),midasAuthScope.getPort()));
    getFromUrl(c,p.resultBldr,p.url,p.username,p.password);
  break;
case Put:
putToUrl(context,p.sendMsg,p.url,p.resultBldr);
break;
case Delete:
deleteAtUrl(context,p.url);
break;
}
log.debug(this + "String_Node_Str" + p.op+ "String_Node_Str"+ p.url);
if (p.resultBldr == null) r.success(null);
 else r.success(p.resultBldr.build());
}
 catch (Exception e) {
if (stopped) return;
log.debug(this + "String_Node_Str" + shortClassName(e.getClass())+ "String_Node_Str"+ p.op+ "String_Node_Str"+ p.url+ "String_Node_Str"+ e.getMessage());
r.error(p,e);
}
}
}