Program: 156212
Project: 156212
Buggy source:
public <T extends Factory>Collection<T> executeQuery(T prototype) throws SQLException {
  List<T> result=new LinkedList<T>();
  try {
    ResultSet resultSet=statement.executeQuery();
    try {
      ResultSetMetaData resultMetaData=resultSet.getMetaData();
      List<ResultSetProcessor<T>> processors=new LinkedList<ResultSetProcessor<T>>();
      Method[] methods=prototype.getClass().getMethods();
      for (      final Method method : methods) {
        if (method.getName().startsWith("String_Node_Str") && method.getParameterTypes().length == 1) {
          final String name=method.getName().substring(3);
          boolean column=false;
          for (int i=1; i <= resultMetaData.getColumnCount(); i++) {
            if (name.equalsIgnoreCase(resultMetaData.getColumnName(i))) {
              column=true;
              break;
            }
          }
          if (!column) {
            continue;
          }
          Class<?> parameterType=method.getParameterTypes()[0];
          if (parameterType.equals(boolean.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getBoolean(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(int.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getInt(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(long.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getLong(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(double.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getDouble(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(String.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getString(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(Date.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,new Date(resultSet.getTimestamp(name).getTime()));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
        }
      }
      while (resultSet.next()) {
        T object=(T)prototype.create();
        for (        ResultSetProcessor<T> processor : processors) {
          processor.process(object,resultSet);
        }
        result.add(object);
      }
    }
  finally {
      resultSet.close();
    }
  }
  finally {
    statement.close();
    connection.close();
  }
  return result;
}

Fixed version (ground truth):
public <T extends Factory>Collection<T> executeQuery(T prototype) throws SQLException {
  List<T> result=new LinkedList<T>();
  try {
    ResultSet resultSet=statement.executeQuery();
    try {
      ResultSetMetaData resultMetaData=resultSet.getMetaData();
      List<ResultSetProcessor<T>> processors=new LinkedList<ResultSetProcessor<T>>();
      Method[] methods=prototype.getClass().getMethods();
      for (      final Method method : methods) {
        if (method.getName().startsWith("String_Node_Str") && method.getParameterTypes().length == 1) {
          final String name=method.getName().substring(3);
          boolean column=false;
          for (int i=1; i <= resultMetaData.getColumnCount(); i++) {
            if (name.equalsIgnoreCase(resultMetaData.getColumnLabel(i))) {
              column=true;
              break;
            }
          }
          if (!column) {
            continue;
          }
          Class<?> parameterType=method.getParameterTypes()[0];
          if (parameterType.equals(boolean.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getBoolean(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(int.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getInt(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(long.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getLong(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(double.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getDouble(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(String.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,resultSet.getString(name));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
 else           if (parameterType.equals(Date.class)) {
            processors.add(new ResultSetProcessor<T>(){
              @Override public void process(              T object,              ResultSet resultSet) throws SQLException {
                try {
                  method.invoke(object,new Date(resultSet.getTimestamp(name).getTime()));
                }
 catch (                IllegalAccessException error) {
                }
catch (                InvocationTargetException error) {
                }
              }
            }
);
          }
        }
      }
      while (resultSet.next()) {
        T object=(T)prototype.create();
        for (        ResultSetProcessor<T> processor : processors) {
          processor.process(object,resultSet);
        }
        result.add(object);
      }
    }
  finally {
      resultSet.close();
    }
  }
  finally {
    statement.close();
    connection.close();
  }
  return result;
}