Program: 161272
Project: 161272
Buggy source:
/** 
 * Search for updates on all machines based on query string
 * @param search The search query
 * @param date   date the updates was handled
 * @return List of updateIds matching search query
 */
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @TypeHint(Update.class) public List<Update> getUpdateIds(@QueryParam("String_Node_Str") final String search,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") final String date) throws IOException {
  final List<Update> updates=getCurrentUpdateIds(search,date);
  final List<Hosts> clusterMembers=host.getClusterMembers();
  if (clusterMembers.isEmpty()) {
    return updates;
  }
  final Map<Hosts,Future<List<Update>>> futures=Maps.newEnumMap(Hosts.class);
  for (  final Hosts clusterMember : clusterMembers) {
    if (clusterMember.equals(host)) {
      continue;
    }
    final String url=String.format("String_Node_Str",clusterMember.getHostName(),jettyConfig.getPort(Audience.INTERNAL),search,date,apiKey);
    final Future<List<Update>> future=client.asyncResource(url).accept(MediaType.APPLICATION_JSON_TYPE).get(new GenericType<List<Update>>(){
    }
);
    futures.put(clusterMember,future);
  }
  for (  final Map.Entry<Hosts,Future<List<Update>>> futureEntry : futures.entrySet()) {
    final Hosts host=futureEntry.getKey();
    final Future<List<Update>> future=futureEntry.getValue();
    try {
      updates.addAll(future.get(CLUSTER_TIMEOUT,TimeUnit.MILLISECONDS));
    }
 catch (    InterruptedException e) {
      updates.add(new Update(host.name(),remoteError(host.name(),e)));
    }
catch (    ExecutionException e) {
      updates.add(new Update(host.name(),remoteError(host.name(),e)));
    }
catch (    TimeoutException e) {
      updates.add(new Update(host.name(),remoteError(host.name(),e)));
    }
  }
  Collections.sort(updates,new Comparator<Update>(){
    @Override public int compare(    final Update update1,    final Update update2){
      return update1.getId().compareTo(update2.toString());
    }
  }
);
  return updates;
}

Fixed version (ground truth):
/** 
 * Search for updates on all machines based on query string
 * @param search The search query
 * @param date   date the updates was handled
 * @return List of updateIds matching search query
 */
@GET @Path("String_Node_Str") @Produces({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML}) @TypeHint(Update.class) public List<Update> getUpdateIds(@QueryParam("String_Node_Str") final String search,@DefaultValue("String_Node_Str") @QueryParam("String_Node_Str") final String date) throws IOException {
  final List<Update> updates=getCurrentUpdateIds(search,date);
  final List<Hosts> clusterMembers=host.getClusterMembers();
  if (clusterMembers.isEmpty()) {
    return updates;
  }
  final Map<Hosts,Future<List<Update>>> futures=Maps.newEnumMap(Hosts.class);
  for (  final Hosts clusterMember : clusterMembers) {
    if (clusterMember.equals(host)) {
      continue;
    }
    final String url=String.format("String_Node_Str",clusterMember.getHostName(),jettyConfig.getPort(Audience.INTERNAL),URLEncoder.encode(search,"String_Node_Str"),date,apiKey);
    final Future<List<Update>> future=client.asyncResource(url).accept(MediaType.APPLICATION_JSON_TYPE).get(new GenericType<List<Update>>(){
    }
);
    futures.put(clusterMember,future);
  }
  for (  final Map.Entry<Hosts,Future<List<Update>>> futureEntry : futures.entrySet()) {
    final Hosts host=futureEntry.getKey();
    final Future<List<Update>> future=futureEntry.getValue();
    try {
      updates.addAll(future.get(CLUSTER_TIMEOUT,TimeUnit.MILLISECONDS));
    }
 catch (    InterruptedException e) {
      updates.add(new Update(host.name(),remoteError(host.name(),e)));
    }
catch (    ExecutionException e) {
      updates.add(new Update(host.name(),remoteError(host.name(),e)));
    }
catch (    TimeoutException e) {
      updates.add(new Update(host.name(),remoteError(host.name(),e)));
    }
  }
  Collections.sort(updates,new Comparator<Update>(){
    @Override public int compare(    final Update update1,    final Update update2){
      return update1.getId().compareTo(update2.toString());
    }
  }
);
  return updates;
}