Program: 82272
Project: 82272
Buggy source:
@Override public BlurResults query(final String table,final BlurQuery blurQuery) throws BlurException, TException {
  try {
    checkTable(table);
    Tracer trace=Trace.trace("String_Node_Str",Trace.param("String_Node_Str",table),Trace.param("String_Node_Str",blurQuery));
    String cluster=_clusterStatus.getCluster(true,table);
    _queryChecker.checkQuery(blurQuery);
    checkSelectorFetchSize(blurQuery.getSelector());
    TableDescriptor tableDescriptor=_clusterStatus.getTableDescriptor(true,cluster,table);
    int shardCount=tableDescriptor.getShardCount();
    if (blurQuery.getUuid() == null) {
      blurQuery.setUuid(UUID.randomUUID().toString());
    }
    BlurUtil.setStartTime(blurQuery);
    trace.done();
    BlurUtil.setStartTime(blurQuery);
    OUTER:     for (int retries=0; retries < _maxDefaultRetries; retries++) {
      Tracer selectorTrace=Trace.trace("String_Node_Str",Trace.param("String_Node_Str",retries));
      final AtomicLongArray facetCounts=BlurUtil.getAtomicLongArraySameLengthAsList(blurQuery.facets);
      Selector selector=blurQuery.getSelector();
      if (selector == null) {
        selector=new Selector();
        selector.setColumnFamiliesToFetch(EMPTY_SET);
        selector.setColumnsToFetch(EMPTY_MAP);
        if (!blurQuery.query.rowQuery) {
          selector.setRecordOnly(true);
        }
      }
 else {
        HighlightOptions highlightOptions=selector.getHighlightOptions();
        if (highlightOptions != null && highlightOptions.getQuery() == null) {
          highlightOptions.setQuery(blurQuery.getQuery());
        }
      }
      blurQuery.setSelector(null);
      selectorTrace.done();
      BlurCommand<BlurResultIterable> command=new BlurCommand<BlurResultIterable>(){
        @Override public BlurResultIterable call(        Client client,        Connection connection) throws BlurException, TException {
          return new BlurResultIterableClient(connection,client,table,blurQuery,facetCounts,_remoteFetchCount);
        }
        @Override public BlurResultIterable call(        Client client) throws BlurException, TException {
          throw new RuntimeException("String_Node_Str");
        }
      }
;
      command.setDetachClient(true);
      MergerBlurResultIterable merger=new MergerBlurResultIterable(blurQuery);
      BlurResultIterable hitsIterable=null;
      try {
        String rowId=blurQuery.getRowId();
        if (rowId == null) {
          Tracer scatterGatherTrace=Trace.trace("String_Node_Str",Trace.param("String_Node_Str",retries));
          try {
            hitsIterable=scatterGather(tableDescriptor.getCluster(),command,merger);
          }
  finally {
            scatterGatherTrace.done();
          }
        }
 else {
          String clientHostnamePort=getNode(table,rowId);
          hitsIterable=_client.execute(clientHostnamePort,command,_maxFetchRetries,_fetchDelay,_maxFetchDelay);
        }
        BlurResults results;
        Tracer convertToBlurResults=Trace.trace("String_Node_Str",Trace.param("String_Node_Str",retries));
        try {
          results=convertToBlurResults(hitsIterable,blurQuery,facetCounts,_executor,selector,table);
        }
  finally {
          convertToBlurResults.done();
        }
        if (!validResults(results,shardCount,blurQuery)) {
          BlurClientManager.sleep(_defaultDelay,_maxDefaultDelay,retries,_maxDefaultRetries);
          Map<String,String> map=_shardServerLayout.get().get(table);
          LOG.info("String_Node_Str",table,map);
          continue OUTER;
        }
        return results;
      }
  finally {
        if (hitsIterable != null) {
          hitsIterable.close();
        }
      }
    }
    throw new BException("String_Node_Str");
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,table,blurQuery);
    if (e instanceof BlurException) {
      throw (BlurException)e;
    }
    throw new BException("String_Node_Str",e,table,blurQuery);
  }
}

Fixed version (ground truth):
@Override public BlurResults query(final String table,final BlurQuery blurQuery) throws BlurException, TException {
  try {
    checkTable(table);
    Tracer trace=Trace.trace("String_Node_Str",Trace.param("String_Node_Str",table),Trace.param("String_Node_Str",blurQuery));
    String cluster=_clusterStatus.getCluster(true,table);
    _queryChecker.checkQuery(blurQuery);
    checkSelectorFetchSize(blurQuery.getSelector());
    TableDescriptor tableDescriptor=_clusterStatus.getTableDescriptor(true,cluster,table);
    int shardCount=tableDescriptor.getShardCount();
    if (blurQuery.getUuid() == null) {
      blurQuery.setUuid(UUID.randomUUID().toString());
    }
    BlurUtil.setStartTime(blurQuery);
    trace.done();
    BlurUtil.setStartTime(blurQuery);
    OUTER:     for (int retries=0; retries < _maxDefaultRetries; retries++) {
      Tracer selectorTrace=Trace.trace("String_Node_Str",Trace.param("String_Node_Str",retries));
      final AtomicLongArray facetCounts=BlurUtil.getAtomicLongArraySameLengthAsList(blurQuery.facets);
      Selector selector=blurQuery.getSelector();
      if (selector == null) {
        selector=new Selector();
        selector.setColumnFamiliesToFetch(EMPTY_SET);
        selector.setColumnsToFetch(EMPTY_MAP);
        if (!blurQuery.query.rowQuery) {
          selector.setRecordOnly(true);
        }
      }
 else {
        HighlightOptions highlightOptions=selector.getHighlightOptions();
        if (highlightOptions != null && highlightOptions.getQuery() == null) {
          highlightOptions.setQuery(blurQuery.getQuery());
        }
      }
      blurQuery.setSelector(null);
      selectorTrace.done();
      BlurCommand<BlurResultIterable> command=new BlurCommand<BlurResultIterable>(){
        @Override public BlurResultIterable call(        Client client,        Connection connection) throws BlurException, TException {
          return new BlurResultIterableClient(connection,client,table,blurQuery,facetCounts,_remoteFetchCount);
        }
        @Override public BlurResultIterable call(        Client client) throws BlurException, TException {
          throw new RuntimeException("String_Node_Str");
        }
      }
;
      command.setDetachClient(true);
      MergerBlurResultIterable merger=new MergerBlurResultIterable(blurQuery);
      BlurResultIterable hitsIterable=null;
      try {
        String rowId=blurQuery.getRowId();
        if (rowId == null) {
          Tracer scatterGatherTrace=Trace.trace("String_Node_Str",Trace.param("String_Node_Str",retries));
          try {
            hitsIterable=scatterGather(tableDescriptor.getCluster(),command,merger);
          }
  finally {
            scatterGatherTrace.done();
          }
        }
 else {
          String clientHostnamePort=getNode(table,rowId);
          hitsIterable=_client.execute(clientHostnamePort,command,_maxFetchRetries,_fetchDelay,_maxFetchDelay);
        }
        BlurResults results;
        Tracer convertToBlurResults=Trace.trace("String_Node_Str",Trace.param("String_Node_Str",retries));
        try {
          results=convertToBlurResults(hitsIterable,blurQuery,facetCounts,_executor,selector,table);
        }
  finally {
          convertToBlurResults.done();
        }
        if (!validResults(results,shardCount,blurQuery)) {
          BlurClientManager.sleep(_defaultDelay,_maxDefaultDelay,retries,_maxDefaultRetries);
          Map<String,String> map=getTableLayout(table);
          LOG.info("String_Node_Str",table,map);
          continue OUTER;
        }
        return results;
      }
  finally {
        if (hitsIterable != null) {
          hitsIterable.close();
        }
      }
    }
    throw new BException("String_Node_Str");
  }
 catch (  Exception e) {
    LOG.error("String_Node_Str",e,table,blurQuery);
    if (e instanceof BlurException) {
      throw (BlurException)e;
    }
    throw new BException("String_Node_Str",e,table,blurQuery);
  }
}