Program: 30969
Project: 30969
Buggy source:
private void download(HttpExchange httpExchange,Project project,DownloadFormat format) throws IOException, SignatureException {
  if (format == DownloadFormat.LIGHTHOUSE_PROJECT) {
    log.info("String_Node_Str");
    byte[] bits=project.getProto().toByteArray();
    httpExchange.getResponseHeaders().add("String_Node_Str",LHUtils.PROJECT_MIME_TYPE);
    httpExchange.sendResponseHeaders(HTTP_OK,bits.length);
    httpExchange.getResponseBody().write(bits);
    httpExchange.close();
    return;
  }
  LHProtos.ProjectStatus.Builder status=LHProtos.ProjectStatus.newBuilder();
  status.setId(project.getID());
  status.setTimestamp(Instant.now().getEpochSecond());
  Map<String,String> params;
  String queryParams=httpExchange.getRequestURI().getRawQuery();
  if (queryParams != null && !queryParams.isEmpty()) {
    params=Splitter.on('&').trimResults().withKeyValueSeparator('=').split(queryParams);
  }
 else {
    params=new HashMap<>();
  }
  boolean authenticated=false;
  String signature=params.get("String_Node_Str");
  String message=params.get("String_Node_Str");
  if (signature != null && message != null) {
    signature=URLDecoder.decode(signature,"String_Node_Str");
    message=URLDecoder.decode(message,"String_Node_Str");
    log.info("String_Node_Str");
    project.authenticateOwner(message,signature);
    log.info("String_Node_Str");
    authenticated=true;
  }
  long totalPledged=0;
  PledgeGroup pledgeGroup=getPledgesFor(project);
  for (  LHProtos.Pledge pledge : pledgeGroup.open) {
    if (authenticated) {
      status.addPledges(pledge);
    }
 else {
      Sha256Hash origHash=LHUtils.hashFromPledge(pledge);
      LHProtos.Pledge.Builder scrubbedPledge=pledge.toBuilder().clearTransactions();
      LHProtos.PledgeDetails.Builder details=scrubbedPledge.getPledgeDetailsBuilder();
      details.setOrigHash(ByteString.copyFrom(origHash.getBytes()));
      details.clearContactAddress();
      status.addPledges(scrubbedPledge);
    }
    totalPledged+=pledge.getPledgeDetails().getTotalInputValue();
  }
  if (!pledgeGroup.claimed.isEmpty())   checkState(pledgeGroup.open.isEmpty());
  status.addAllPledges(pledgeGroup.claimed);
  LighthouseBackend.ProjectStateInfo info=projectStates.get(project.getID());
  if (info.claimedBy != null) {
    status.setClaimedBy(ByteString.copyFrom(info.claimedBy.getBytes()));
  }
  status.setValuePledgedSoFar(totalPledged);
  final LHProtos.ProjectStatus proto=status.build();
  byte[] bits;
switch (format) {
case PBUF:
    bits=proto.toByteArray();
  break;
case JSON:
bits=JsonFormat.printToString(proto).getBytes(Charsets.UTF_8);
break;
case HTML:
bits=HtmlFormat.printToString(proto).getBytes(Charsets.UTF_8);
break;
case XML:
bits=XmlFormat.printToString(proto).getBytes(Charsets.UTF_8);
break;
default :
throw new AssertionError();
}
httpExchange.sendResponseHeaders(HTTP_OK,bits.length);
httpExchange.getResponseBody().write(bits);
httpExchange.close();
}

Fixed version (ground truth):
private void download(HttpExchange httpExchange,Project project,DownloadFormat format) throws IOException, SignatureException {
  if (format == DownloadFormat.LIGHTHOUSE_PROJECT) {
    log.info("String_Node_Str");
    byte[] bits=project.getProto().toByteArray();
    httpExchange.getResponseHeaders().add("String_Node_Str",LHUtils.PROJECT_MIME_TYPE);
    httpExchange.sendResponseHeaders(HTTP_OK,bits.length);
    httpExchange.getResponseBody().write(bits);
    httpExchange.close();
    return;
  }
  LHProtos.ProjectStatus.Builder status=LHProtos.ProjectStatus.newBuilder();
  status.setId(project.getID());
  status.setTimestamp(Instant.now().getEpochSecond());
  Map<String,String> params;
  String queryParams=httpExchange.getRequestURI().getRawQuery();
  if (queryParams != null && !queryParams.isEmpty()) {
    params=Splitter.on('&').trimResults().withKeyValueSeparator('=').split(queryParams);
  }
 else {
    params=new HashMap<>();
  }
  boolean authenticated=false;
  String signature=params.get("String_Node_Str");
  String message=params.get("String_Node_Str");
  if (signature != null && message != null) {
    signature=URLDecoder.decode(signature,"String_Node_Str");
    message=URLDecoder.decode(message,"String_Node_Str");
    log.info("String_Node_Str");
    project.authenticateOwner(message,signature);
    log.info("String_Node_Str");
    authenticated=true;
  }
  PledgeGroup pledgeGroup=getPledgesFor(project);
  long totalPledged=addPledgesToStatus(status,authenticated,pledgeGroup.open);
  if (!pledgeGroup.claimed.isEmpty())   checkState(pledgeGroup.open.isEmpty());
  addPledgesToStatus(status,authenticated,pledgeGroup.claimed);
  LighthouseBackend.ProjectStateInfo info=projectStates.get(project.getID());
  if (info.claimedBy != null) {
    status.setClaimedBy(ByteString.copyFrom(info.claimedBy.getBytes()));
  }
  status.setValuePledgedSoFar(totalPledged);
  final LHProtos.ProjectStatus proto=status.build();
  byte[] bits;
switch (format) {
case PBUF:
    bits=proto.toByteArray();
  break;
case JSON:
bits=JsonFormat.printToString(proto).getBytes(Charsets.UTF_8);
break;
case HTML:
bits=HtmlFormat.printToString(proto).getBytes(Charsets.UTF_8);
break;
case XML:
bits=XmlFormat.printToString(proto).getBytes(Charsets.UTF_8);
break;
default :
throw new AssertionError();
}
httpExchange.sendResponseHeaders(HTTP_OK,bits.length);
httpExchange.getResponseBody().write(bits);
httpExchange.close();
}