Program: 8139
Project: 8139
Buggy source:
/** 
 * Retrieves the counters as per the   {@link CounterRequest} specification.
 * @param request for counters.
 * @return list of {@link Counter}
 * @throws MetricsServiceException
 * @throws TException raised when thrift related issues.
 */
@Override public List<Counter> getCounters(CounterRequest request) throws MetricsServiceException, TException {
  List<Counter> results=Lists.newArrayList();
  validateArguments(request.getArgument());
  String sql=null;
  if (request.getName() == null || request.getName().size() == 0) {
    sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  }
 else {
    Iterable<String> iterator=Iterables.transform(request.getName(),new Function<String,String>(){
      @Override public String apply(      @Nullable String input){
        return "String_Node_Str" + input + "String_Node_Str";
      }
    }
);
    String values=Joiner.on("String_Node_Str").join(iterator);
    sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + values + "String_Node_Str";
  }
  PreparedStatement stmt=null;
  ResultSet rs=null;
  try {
    stmt=getConnection().prepareStatement(sql);
    stmt.setString(1,request.getArgument().getAccountId());
    stmt.setString(2,request.getArgument().getApplicationId());
    stmt.setString(3,request.getArgument().getFlowId());
    rs=stmt.executeQuery();
    while (rs.next()) {
      results.add(new Counter(rs.getString("String_Node_Str"),rs.getString("String_Node_Str"),rs.getFloat("String_Node_Str")));
    }
  }
 catch (  SQLException e) {
    Log.warn("String_Node_Str",e.getMessage());
  }
 finally {
    if (stmt != null) {
      try {
        stmt.close();
      }
 catch (      SQLException e) {
        Log.warn("String_Node_Str",e.getMessage());
      }
    }
    if (rs != null) {
      try {
        rs.close();
      }
 catch (      SQLException e) {
        Log.warn("String_Node_Str",e.getMessage());
      }
    }
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Retrieves the counters as per the   {@link CounterRequest} specification.
 * @param request for counters.
 * @return list of {@link Counter}
 * @throws MetricsServiceException
 * @throws TException raised when thrift related issues.
 */
@Override public List<Counter> getCounters(CounterRequest request) throws MetricsServiceException, TException {
  List<Counter> results=Lists.newArrayList();
  validateArguments(request.getArgument());
  String sql=null;
  if (request.getName() == null || request.getName().size() == 0) {
    sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  }
 else {
    Iterable<String> iterator=Iterables.transform(request.getName(),new Function<String,String>(){
      @Override public String apply(      @Nullable String input){
        return "String_Node_Str" + input + "String_Node_Str";
      }
    }
);
    String values=Joiner.on("String_Node_Str").join(iterator);
    sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str" + values + "String_Node_Str";
  }
  Connection connection=null;
  PreparedStatement stmt=null;
  ResultSet rs=null;
  try {
    connection=getConnection();
    stmt=connection.prepareStatement(sql);
    stmt.setString(1,request.getArgument().getAccountId());
    stmt.setString(2,request.getArgument().getApplicationId());
    stmt.setString(3,request.getArgument().getFlowId());
    rs=stmt.executeQuery();
    while (rs.next()) {
      results.add(new Counter(rs.getString("String_Node_Str"),rs.getString("String_Node_Str"),rs.getFloat("String_Node_Str")));
    }
  }
 catch (  SQLException e) {
    Log.warn("String_Node_Str",e.getMessage());
  }
 finally {
    try {
      if (rs != null) {
        rs.close();
      }
      if (stmt != null) {
        stmt.close();
      }
      if (connection != null) {
        connection.close();
      }
    }
 catch (    SQLException e) {
      Log.warn("String_Node_Str",e.getMessage());
    }
  }
  return results;
}