Program: 13278
Project: 13278
Buggy source:
@Override public List<Resource> query(QueryRequest request) throws ResourceException {
  String fullId=request.getResourceName();
  String type=fullId;
  logger.trace("String_Node_Str",fullId,type);
  Map<String,Object> params=new HashMap<String,Object>();
  params.putAll(request.getAdditionalQueryParameters());
  params.put(TableQueries.QUERY_ID,request.getQueryId());
  params.put(TableQueries.QUERY_EXPRESSION,request.getQueryExpression());
  Connection connection=null;
  try {
    TableHandler tableHandler=getTableHandler(type);
    if (tableHandler == null) {
      throw ResourceException.getException(ResourceException.INTERNAL_ERROR,"String_Node_Str" + type);
    }
    connection=getConnection();
    connection.setAutoCommit(true);
    List<Map<String,Object>> docs=tableHandler.query(type,params,connection);
    List<Resource> results=new ArrayList<Resource>();
    for (    Map<String,Object> resultMap : docs) {
      String id=(String)resultMap.get("String_Node_Str");
      String rev=(String)resultMap.get("String_Node_Str");
      JsonValue value=new JsonValue(resultMap);
      Resource resultResource=new Resource(id,rev,value);
      results.add(resultResource);
    }
    return results;
  }
 catch (  SQLException ex) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",new Object[]{fullId,ex.getErrorCode(),ex.getSQLState(),ex});
    }
    throw new InternalServerErrorException("String_Node_Str" + ex.getMessage(),ex);
  }
catch (  ResourceException ex) {
    logger.debug("String_Node_Str",fullId,ex);
    throw ex;
  }
 finally {
    CleanupHelper.loggedClose(connection);
  }
}

Fixed version (ground truth):
@Override public List<Resource> query(QueryRequest request) throws ResourceException {
  String fullId=request.getResourceName();
  String type=trimStartingSlash(fullId);
  logger.trace("String_Node_Str",fullId,type);
  Map<String,Object> params=new HashMap<String,Object>();
  params.putAll(request.getAdditionalQueryParameters());
  params.put(TableQueries.QUERY_ID,request.getQueryId());
  params.put(TableQueries.QUERY_EXPRESSION,request.getQueryExpression());
  Connection connection=null;
  try {
    TableHandler tableHandler=getTableHandler(type);
    if (tableHandler == null) {
      throw ResourceException.getException(ResourceException.INTERNAL_ERROR,"String_Node_Str" + type);
    }
    connection=getConnection();
    connection.setAutoCommit(true);
    List<Map<String,Object>> docs=tableHandler.query(type,params,connection);
    List<Resource> results=new ArrayList<Resource>();
    for (    Map<String,Object> resultMap : docs) {
      String id=(String)resultMap.get("String_Node_Str");
      String rev=(String)resultMap.get("String_Node_Str");
      JsonValue value=new JsonValue(resultMap);
      Resource resultResource=new Resource(id,rev,value);
      results.add(resultResource);
    }
    return results;
  }
 catch (  SQLException ex) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",new Object[]{fullId,ex.getErrorCode(),ex.getSQLState(),ex});
    }
    throw new InternalServerErrorException("String_Node_Str" + ex.getMessage(),ex);
  }
catch (  ResourceException ex) {
    logger.debug("String_Node_Str",fullId,ex);
    throw ex;
  }
 finally {
    CleanupHelper.loggedClose(connection);
  }
}