nus-yam/ex-repair huggingface dataset:
Program: 54562
Project: 54562
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void setPreparedStatementNullableValue(PreparedStatement preparedStatement,int parameterIndex,FieldType fieldType,KVValue<?> value) throws SQLException {
  DataTypeForKV dataType=dataTypeProvider.getDataType(fieldType);
  Converter converter=dataType.getConverter();
  KVValueConverter valueConverter=dataType.getKVValueConverter();
  SqlBinding sqlBinding=valueConverter.getSqlBinding();
  if (value != null) {
    sqlBinding.set(preparedStatement,parameterIndex,converter.to(value));
  }
 else {
    preparedStatement.setNull(parameterIndex,dataType.getSQLType());
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void setPreparedStatementNullableValue(PreparedStatement preparedStatement,int parameterIndex,FieldType fieldType,KVValue<?> value) throws SQLException {
  DataTypeForKV dataType=dataTypeProvider.getDataType(fieldType);
  if (value != null) {
    KVValueConverter valueConverter=dataType.getKVValueConverter();
    SqlBinding sqlBinding=valueConverter.getSqlBinding();
    Converter converter=dataType.getConverter();
    sqlBinding.set(preparedStatement,parameterIndex,converter.to(value));
  }
 else {
    preparedStatement.setNull(parameterIndex,dataType.getSQLType());
  }
}
Program: 54563
Project: 54563
Buggy source:
public Result<Record> executeStatementWithResult(DSLContext dsl,String statement,Context context){
  Connection c=dsl.configuration().connectionProvider().acquire();
  try (PreparedStatement ps=c.prepareStatement(statement)){
    ResultSet resultSet=ps.executeQuery();
    return dsl.fetch(resultSet);
  }
 catch (  SQLException ex) {
    throw errorHandler.handleException(context,ex);
  }
 finally {
    dsl.configuration().connectionProvider().release(c);
  }
}

Fixed version (ground truth):
public Result<Record> executeStatementWithResult(DSLContext dsl,String statement,Context context){
  Connection c=dsl.configuration().connectionProvider().acquire();
  try (PreparedStatement ps=c.prepareStatement(statement)){
    try (ResultSet resultSet=ps.executeQuery()){
      return dsl.fetch(resultSet);
    }
   }
 catch (  SQLException ex) {
    throw errorHandler.handleException(context,ex);
  }
 finally {
    dsl.configuration().connectionProvider().release(c);
  }
}
Program: 54564
Project: 54564
Buggy source:
private static TableRef createChild(TableRefFactory tableRefFactory,TableRef tableRef,String tableRefName){
  if (isArrayDimension(tableRefName)) {
    int dimension=Integer.valueOf(tableRefName.substring(1));
    tableRef=tableRefFactory.createChild(tableRef,dimension);
  }
 else {
    tableRef=tableRefFactory.createChild(tableRef,unescapeTableRefName(tableRefName).intern());
  }
  return tableRef;
}

Fixed version (ground truth):
private static TableRef createChild(TableRefFactory tableRefFactory,TableRef tableRef,String tableRefName){
  if (isArrayDimension(tableRefName)) {
    Integer dimension=Integer.valueOf(tableRefName.substring(1));
    tableRef=tableRefFactory.createChild(tableRef,dimension);
  }
 else {
    tableRef=tableRefFactory.createChild(tableRef,unescapeTableRefName(tableRefName).intern());
  }
  return tableRef;
}
Program: 54565
Project: 54565
Buggy source:
public ResultSetNewDocPartRow() throws IllegalDocPartRowException {
  Collection<InternalField<?>> internalFields=metaDataReadInterface.getInternalFields(metaDocPart);
  Integer _did=null;
  Integer _pid=null;
  Integer _rid=null;
  Integer _seq=null;
  int columnIndex=1;
  MetaDocPartTable<Object,MetaDocPartRecord<Object>> metaDocPartTable=metaDataReadInterface.getMetaDocPartTable();
  for (  InternalField<?> internalField : internalFields) {
    try {
      if (internalField.isDid()) {
        _did=metaDocPartTable.DID.getValue(rs,columnIndex);
      }
 else       if (internalField.isRid()) {
        _rid=metaDocPartTable.RID.getValue(rs,columnIndex);
      }
 else       if (internalField.isPid()) {
        _pid=metaDocPartTable.PID.getValue(rs,columnIndex);
      }
 else       if (internalField.isSeq()) {
        _seq=metaDocPartTable.SEQ.getValue(rs,columnIndex);
      }
    }
 catch (    SQLException sqlException) {
      throw errorHandler.handleException(Context.FETCH,sqlException);
    }
    columnIndex++;
    if (_did == null) {
      throw new IllegalDocPartRowException(_did,_rid,_pid,_seq,"String_Node_Str" + metaDocPart.getTableRef());
    }
    if (_rid == null) {
      _rid=_did;
    }
    if (_pid == null) {
      _pid=_did;
    }
  }
  this.did=_did;
  this.rid=_rid;
  this.pid=_pid;
  this.seq=_seq;
  this.firstUserColumnIndex=columnIndex;
}

Fixed version (ground truth):
public ResultSetNewDocPartRow() throws IllegalDocPartRowException {
  Collection<InternalField<?>> internalFields=metaDataReadInterface.getInternalFields(metaDocPart);
  Integer _did=null;
  Integer _pid=null;
  Integer _rid=null;
  Integer _seq=null;
  int columnIndex=1;
  MetaDocPartTable<Object,MetaDocPartRecord<Object>> metaDocPartTable=metaDataReadInterface.getMetaDocPartTable();
  for (  InternalField<?> internalField : internalFields) {
    try {
      if (internalField.isDid()) {
        _did=metaDocPartTable.DID.getValue(rs,columnIndex);
      }
 else       if (internalField.isRid()) {
        _rid=metaDocPartTable.RID.getValue(rs,columnIndex);
      }
 else       if (internalField.isPid()) {
        _pid=metaDocPartTable.PID.getValue(rs,columnIndex);
      }
 else       if (internalField.isSeq()) {
        _seq=metaDocPartTable.SEQ.getValue(rs,columnIndex);
      }
    }
 catch (    SQLException sqlException) {
      throw errorHandler.handleException(Context.FETCH,sqlException);
    }
    columnIndex++;
    if (_did == null) {
      throw new IllegalDocPartRowException(null,_rid,_pid,_seq,"String_Node_Str" + metaDocPart.getTableRef());
    }
    if (_rid == null) {
      _rid=_did;
    }
    if (_pid == null) {
      _pid=_did;
    }
  }
  this.did=_did;
  this.rid=_rid;
  this.pid=_pid;
  this.seq=_seq;
  this.firstUserColumnIndex=columnIndex;
}
Program: 54566
Project: 54566
Buggy source:
@Override public long deleteCollectionDocParts(@Nonnull DSLContext dsl,@Nonnull String schemaName,@Nonnull MetaCollection metaCollection,@Nonnull DidCursor didCursor){
  Iterator<? extends MetaDocPart> iterator=metaCollection.streamContainedMetaDocParts().sorted(TableRefComparator.MetaDocPart.DESC).iterator();
  Connection c=dsl.configuration().connectionProvider().acquire();
  try {
    int maxBatchSize=100;
    long updated=0;
    while (didCursor.hasNext()) {
      Collection<Integer> dids=didCursor.getNextBatch(maxBatchSize);
      while (iterator.hasNext()) {
        MetaDocPart metaDocPart=iterator.next();
        String statement=getDeleteDocPartsStatement(schemaName,metaDocPart.getIdentifier(),dids);
        sqlHelper.executeUpdate(c,statement,Context.DELETE);
      }
      updated+=dids.size();
    }
    return updated;
  }
  finally {
    dsl.configuration().connectionProvider().release(c);
  }
}

Fixed version (ground truth):
@Override public long deleteCollectionDocParts(@Nonnull DSLContext dsl,@Nonnull String schemaName,@Nonnull MetaCollection metaCollection,@Nonnull DidCursor didCursor){
  Connection c=dsl.configuration().connectionProvider().acquire();
  try {
    int maxBatchSize=100;
    long updated=0;
    while (didCursor.hasNext()) {
      Collection<Integer> dids=didCursor.getNextBatch(maxBatchSize);
      Iterator<? extends MetaDocPart> iterator=metaCollection.streamContainedMetaDocParts().sorted(TableRefComparator.MetaDocPart.DESC).iterator();
      while (iterator.hasNext()) {
        MetaDocPart metaDocPart=iterator.next();
        String statement=getDeleteDocPartsStatement(schemaName,metaDocPart.getIdentifier(),dids);
        sqlHelper.executeUpdate(c,statement,Context.DELETE);
      }
      updated+=dids.size();
    }
    return updated;
  }
  finally {
    dsl.configuration().connectionProvider().release(c);
  }
}
Program: 54568
Project: 54568
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void checkSchema(Schema torodbSchema,SqlInterface sqlInterface) throws InvalidDatabaseException {
  SemanticTable<?>[] metaTables=new SemanticTable[]{sqlInterface.getMetaDatabaseTable(),sqlInterface.getMetaCollectionTable(),sqlInterface.getMetaDocPartTable(),sqlInterface.getMetaFieldTable(),sqlInterface.getMetaScalarTable()};
  for (  SemanticTable metaTable : metaTables) {
    String metaTableName=metaTable.getName();
    boolean metaTableFound=false;
    for (    Table<?> table : torodbSchema.getTables()) {
      if (sqlInterface.isSameIdentifier(table.getName(),metaTableName)) {
        metaTable.checkSemanticallyEquals(table);
        metaTableFound=true;
        LOGGER.info(table + "String_Node_Str");
      }
    }
    if (!metaTableFound) {
      throw new InvalidDatabaseException("String_Node_Str" + TorodbSchema.TORODB_SCHEMA + "String_Node_Str"+ "String_Node_Str"+ metaTableName+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void checkSchema(Schema torodbSchema,SqlInterface sqlInterface) throws InvalidDatabaseException {
  SemanticTable<?>[] metaTables=new SemanticTable[]{sqlInterface.getMetaDatabaseTable(),sqlInterface.getMetaCollectionTable(),sqlInterface.getMetaDocPartTable(),sqlInterface.getMetaFieldTable(),sqlInterface.getMetaScalarTable()};
  for (  SemanticTable metaTable : metaTables) {
    String metaTableName=metaTable.getName();
    boolean metaTableFound=false;
    for (    Table<?> table : torodbSchema.getTables()) {
      if (sqlInterface.isSameIdentifier(table.getName(),metaTableName)) {
        metaTable.checkSemanticallyEquals(table);
        metaTableFound=true;
        LOGGER.info(table + "String_Node_Str");
      }
    }
    if (!metaTableFound) {
      throw new InvalidDatabaseException("String_Node_Str" + TorodbSchema.IDENTIFIER + "String_Node_Str"+ "String_Node_Str"+ metaTableName+ "String_Node_Str");
    }
  }
}
Program: 54569
Project: 54569
Buggy source:
@Override public void checkOrCreate(DSLContext dsl,Meta jooqMeta,SqlInterface sqlInterface,SqlHelper sqlHelper) throws SQLException, IOException, InvalidDatabaseException {
  Schema torodbSchema=null;
  for (  Schema schema : jooqMeta.getSchemas()) {
    if (sqlInterface.isSameIdentifier(TorodbSchema.TORODB_SCHEMA,schema.getName())) {
      torodbSchema=schema;
      break;
    }
  }
  if (torodbSchema == null) {
    LOGGER.info("String_Node_Str",TorodbSchema.TORODB_SCHEMA);
    createSchema(dsl,sqlInterface,sqlHelper);
    LOGGER.info("String_Node_Str",TorodbSchema.TORODB_SCHEMA);
  }
 else {
    LOGGER.info("String_Node_Str",TorodbSchema.TORODB_SCHEMA);
    checkSchema(torodbSchema,sqlInterface);
    LOGGER.info("String_Node_Str",TorodbSchema.TORODB_SCHEMA);
  }
}

Fixed version (ground truth):
@Override public void checkOrCreate(DSLContext dsl,Meta jooqMeta,SqlInterface sqlInterface,SqlHelper sqlHelper) throws SQLException, IOException, InvalidDatabaseException {
  Schema torodbSchema=null;
  for (  Schema schema : jooqMeta.getSchemas()) {
    if (sqlInterface.isSameIdentifier(TorodbSchema.IDENTIFIER,schema.getName())) {
      torodbSchema=schema;
      break;
    }
  }
  if (torodbSchema == null) {
    LOGGER.info("String_Node_Str",TorodbSchema.IDENTIFIER);
    createSchema(dsl,sqlInterface,sqlHelper);
    LOGGER.info("String_Node_Str",TorodbSchema.IDENTIFIER);
  }
 else {
    LOGGER.info("String_Node_Str",TorodbSchema.IDENTIFIER);
    checkSchema(torodbSchema,sqlInterface);
    LOGGER.info("String_Node_Str",TorodbSchema.IDENTIFIER);
  }
}
Program: 54570
Project: 54570
Buggy source:
protected void createSchema(DSLContext dsl,SqlInterface sqlInterface,SqlHelper sqlHelper) throws SQLException, IOException {
  sqlInterface.createSchema(dsl,TorodbSchema.TORODB_SCHEMA);
  sqlInterface.createMetaDatabaseTable(dsl);
  sqlInterface.createMetaCollectionTable(dsl);
  sqlInterface.createMetaDocPartTable(dsl);
  sqlInterface.createMetaFieldTable(dsl);
  sqlInterface.createMetaScalarTable(dsl);
}

Fixed version (ground truth):
protected void createSchema(DSLContext dsl,SqlInterface sqlInterface,SqlHelper sqlHelper) throws SQLException, IOException {
  sqlInterface.createSchema(dsl,TorodbSchema.IDENTIFIER);
  sqlInterface.createMetaDatabaseTable(dsl);
  sqlInterface.createMetaCollectionTable(dsl);
  sqlInterface.createMetaDocPartTable(dsl);
  sqlInterface.createMetaFieldTable(dsl);
  sqlInterface.createMetaScalarTable(dsl);
}
Program: 54571
Project: 54571
Buggy source:
/** 
 * No further instances allowed
 */
protected TorodbSchema(){
  super(TORODB_SCHEMA);
}

Fixed version (ground truth):
/** 
 * No further instances allowed
 */
protected TorodbSchema(){
  super(IDENTIFIER);
}
Program: 54572
Project: 54572
Buggy source:
/** 
 * No further instances allowed
 */
private MongoTimestampUDT(){
  super("String_Node_Str",TorodbSchema.TORODB);
  getDataType();
}

Fixed version (ground truth):
/** 
 * No further instances allowed
 */
private MongoTimestampUDT(){
  super(IDENTIFIER,TorodbSchema.TORODB);
  getDataType();
}
Program: 54574
Project: 54574
Buggy source:
@Inject public PostgreSQLWriteInterface(PostgreSQLMetaDataReadInterface metaDataReadInterface,PostgreSQLErrorHandler errorHandler,SqlHelper sqlHelper){
  super(metaDataReadInterface,errorHandler,sqlHelper);
  this.postgreSQLMetaDataReadInterface=metaDataReadInterface;
  this.errorHandler=errorHandler;
}

Fixed version (ground truth):
@Inject public PostgreSQLWriteInterface(PostgreSQLMetaDataReadInterface metaDataReadInterface,PostgreSQLErrorHandler errorHandler,SqlHelper sqlHelper){
  super(metaDataReadInterface,errorHandler,sqlHelper);
  this.postgreSQLMetaDataReadInterface=metaDataReadInterface;
  this.errorHandler=errorHandler;
  this.sqlHelper=sqlHelper;
}
Program: 54575
Project: 54575
Buggy source:
/** 
 * Setter for <code>torodb.scalar.idenftifier</code>.
 */
public void setIdentifier(String value){
  set(5,value);
}

Fixed version (ground truth):
/** 
 * Setter for <code>torodb.scalar.idenftifier</code>.
 */
public void setIdentifier(String value){
  set(4,value);
}
Program: 54576
Project: 54576
Buggy source:
/** 
 * Getter for <code>torodb.scalar.idenftifier</code>.
 */
public String getIdentifier(){
  return (String)getValue(5);
}

Fixed version (ground truth):
/** 
 * Getter for <code>torodb.scalar.idenftifier</code>.
 */
public String getIdentifier(){
  return (String)getValue(4);
}
Program: 54577
Project: 54577
Buggy source:
/** 
 * Setter for <code>torodb.scalar.type</code>.
 */
public void setType(FieldType value){
  set(4,value);
}

Fixed version (ground truth):
/** 
 * Setter for <code>torodb.scalar.type</code>.
 */
public void setType(FieldType value){
  set(3,value);
}
Program: 54578
Project: 54578
Buggy source:
/** 
 * Getter for <code>torodb.scalar.type</code>.
 */
public FieldType getType(){
  return (FieldType)getValue(4);
}

Fixed version (ground truth):
/** 
 * Getter for <code>torodb.scalar.type</code>.
 */
public FieldType getType(){
  return (FieldType)getValue(3);
}
Program: 54579
Project: 54579
Buggy source:
@Override public ImmutableMetaDatabase getMetaDatabaseByIdentifier(String schemaDbName){
  return dbsByName.get(schemaDbName);
}

Fixed version (ground truth):
@Override public ImmutableMetaDatabase getMetaDatabaseByIdentifier(String schemaDbName){
  return dbsByIdentifier.get(schemaDbName);
}
Program: 54580
Project: 54580
Buggy source:
public ImmutableMetaSnapshot(Map<String,ImmutableMetaDatabase> dbsByName){
  this.dbsByName=Collections.unmodifiableMap(dbsByName);
  this.dbsByIdentifier=new HashMap<>(dbsByName.size());
  for (  ImmutableMetaDatabase schema : dbsByName.values()) {
    dbsByIdentifier.put(schema.getIdentifier(),schema);
  }
}

Fixed version (ground truth):
public ImmutableMetaSnapshot(@DoNotChange Map<String,ImmutableMetaDatabase> dbsById){
  this.dbsByIdentifier=Collections.unmodifiableMap(dbsById);
  this.dbsByName=new HashMap<>(dbsById.size());
  for (  ImmutableMetaDatabase schema : dbsById.values()) {
    dbsByName.put(schema.getName(),schema);
  }
}
Program: 54581
Project: 54581
Buggy source:
private static CheckCase checkCompatibility(Object nameObject,Object idObject){
}

Fixed version (ground truth):
private static CheckCase checkCompatibility(Object nameObject,Object idObject){
  if (Objects.equals(nameObject,idObject)) {
    return CheckCase.OK;
  }
  if (nameObject != null) {
    return CheckCase.DIFFERENT_NAME;
  }
  if (idObject != null) {
    return CheckCase.DIFFERENT_ID;
  }
  throw new AssertionError();
}
Program: 54584
Project: 54584
Buggy source:
@Override public void close() throws SQLException {
  connection.commit();
  connection.rollback();
  openCursors.remove(cursorId);
}

Fixed version (ground truth):
@Override public void close() throws SQLException {
  connection.commit();
  connection.close();
  openCursors.remove(cursorId);
}
Program: 54585
Project: 54585
Buggy source:
@Override public String to(NamedToroIndex userObject){
  JsonObjectBuilder objectBuilder=Json.createObjectBuilder();
  objectBuilder.add(NAME_KEY,userObject.getName());
  if (userObject.isUnique()) {
    objectBuilder.add(UNIQUE_KEY,true);
  }
  JsonArrayBuilder attsBuilder=Json.createArrayBuilder();
  JsonArrayBuilder descBuilder=Json.createArrayBuilder();
  int attPosition=0;
  boolean hasDescending=false;
  for (  Map.Entry<AttributeReference,Boolean> entry : userObject.getAttributes().entrySet()) {
    attsBuilder.add(entry.getKey().toString());
    if (!entry.getValue()) {
      descBuilder.add(attPosition);
      attPosition++;
      hasDescending=true;
    }
  }
  objectBuilder.add(ATTS_KEY,attsBuilder);
  if (hasDescending) {
    objectBuilder.add(DESCENDING,descBuilder);
  }
  StringWriter stringWriter=new StringWriter(200);
  JsonWriter jsonWriter=Json.createWriter(stringWriter);
  jsonWriter.writeObject(objectBuilder.build());
  return stringWriter.toString();
}

Fixed version (ground truth):
@Override public String to(NamedToroIndex userObject){
  JsonObjectBuilder objectBuilder=Json.createObjectBuilder();
  objectBuilder.add(NAME_KEY,userObject.getName());
  if (userObject.isUnique()) {
    objectBuilder.add(UNIQUE_KEY,true);
  }
  JsonArrayBuilder attsBuilder=Json.createArrayBuilder();
  JsonArrayBuilder descBuilder=Json.createArrayBuilder();
  int attPosition=0;
  boolean hasDescending=false;
  for (  Map.Entry<AttributeReference,Boolean> entry : userObject.getAttributes().entrySet()) {
    attsBuilder.add(entry.getKey().toString());
    if (!entry.getValue()) {
      descBuilder.add(attPosition);
      hasDescending=true;
    }
    attPosition++;
  }
  objectBuilder.add(ATTS_KEY,attsBuilder);
  if (hasDescending) {
    objectBuilder.add(DESCENDING,descBuilder);
  }
  StringWriter stringWriter=new StringWriter(200);
  JsonWriter jsonWriter=Json.createWriter(stringWriter);
  jsonWriter.writeObject(objectBuilder.build());
  return stringWriter.toString();
}
Program: 54586
Project: 54586
Buggy source:
@Override public Integer createPathViews(String collection) throws UnsupportedStructurePathViewException {
  try {
    return getDelegate().createPathViews(collection);
  }
 catch (  ImplementationDbException ex) {
    throw new ToroImplementationException(ex);
  }
}

Fixed version (ground truth):
@Override public Integer createPathViews(String collection) throws IllegalPathViewException {
  try {
    return getDelegate().createPathViews(collection);
  }
 catch (  ImplementationDbException ex) {
    throw new ToroImplementationException(ex);
  }
}
Program: 54587
Project: 54587
Buggy source:
@Override public Integer createPathViews(String collection) throws UnsupportedStructurePathViewException {
  PathViewHandler handler=new DefaultPathViewHandler(getMeta(),getDsl());
  return handler.createPathViews(collection);
}

Fixed version (ground truth):
@Override public Integer createPathViews(String collection) throws IllegalPathViewException {
  PathViewHandler.Callback callback=new DefaultPathViewHandlerCallback(getDsl());
  PathViewHandler handler=new PathViewHandler(getMeta(),callback);
  return handler.createPathViews(collection);
}
Program: 54588
Project: 54588
Buggy source:
public BasicType toBasicType(String columnName,int jdbcIntType,String jdbcStringType){
switch (jdbcIntType) {
case Types.BIGINT:
    return BasicType.LONG;
case Types.BOOLEAN:
case Types.BIT:
  return BasicType.BOOLEAN;
case Types.DATE:
return BasicType.DATE;
case Types.DOUBLE:
return BasicType.DOUBLE;
case Types.INTEGER:
return BasicType.INTEGER;
case Types.SMALLINT:
case Types.NULL:
return BasicType.NULL;
case Types.TIME:
return BasicType.TIME;
case Types.TIMESTAMP:
return BasicType.DATETIME;
case Types.VARCHAR:
return BasicType.STRING;
case Types.OTHER:
if (jdbcStringType.equals("String_Node_Str")) {
return BasicType.ARRAY;
}
break;
case Types.DISTINCT:
{
if (jdbcStringType.equals("String_Node_Str")) {
return BasicType.TWELVE_BYTES;
}
if (jdbcStringType.equals("String_Node_Str")) {
return BasicType.PATTERN;
}
break;
}
}
throw new ToroImplementationException("String_Node_Str" + jdbcStringType + "String_Node_Str"+ jdbcIntType+ "String_Node_Str"+ columnName+ "String_Node_Str");
}

Fixed version (ground truth):
public BasicType toBasicType(String columnName,int jdbcIntType,String jdbcStringType){
switch (jdbcIntType) {
case Types.BIGINT:
    return BasicType.LONG;
case Types.BOOLEAN:
case Types.BIT:
  return BasicType.BOOLEAN;
case Types.DATE:
return BasicType.DATE;
case Types.DOUBLE:
return BasicType.DOUBLE;
case Types.INTEGER:
return BasicType.INTEGER;
case Types.SMALLINT:
case Types.NULL:
return BasicType.NULL;
case Types.TIME:
return BasicType.TIME;
case Types.TIMESTAMP:
return BasicType.DATETIME;
case Types.VARCHAR:
return BasicType.STRING;
case Types.OTHER:
if (jdbcStringType.equals("String_Node_Str")) {
return BasicType.ARRAY;
}
break;
case Types.DISTINCT:
{
if (jdbcStringType.equals("String_Node_Str") || jdbcStringType.equals(TwelveBytesUDT.TWELVE_BYTES.getName())) {
return BasicType.TWELVE_BYTES;
}
if (jdbcStringType.equals("String_Node_Str") || jdbcStringType.equals("String_Node_Str")) {
return BasicType.PATTERN;
}
break;
}
}
throw new ToroImplementationException("String_Node_Str" + jdbcStringType + "String_Node_Str"+ jdbcIntType+ "String_Node_Str"+ columnName+ "String_Node_Str");
}
Program: 54589
Project: 54589
Buggy source:
private static void printConfig(Config config,Console console,ObjectWriter objectWriter) throws IOException, JsonGenerationException, JsonMappingException, UnsupportedEncodingException {
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  PrintStream printStream=new PrintStream(byteArrayOutputStream,false,Charsets.UTF_8.name());
  objectWriter.writeValue(printStream,config);
  console.print(byteArrayOutputStream.toString(Charsets.UTF_8.name()));
}

Fixed version (ground truth):
private static void printConfig(Config config,Console console,ObjectWriter objectWriter) throws IOException, JsonGenerationException, JsonMappingException, UnsupportedEncodingException {
  ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
  PrintStream printStream=new PrintStream(byteArrayOutputStream,false,Charsets.UTF_8.name());
  objectWriter.writeValue(printStream,config);
  console.println(byteArrayOutputStream.toString(Charsets.UTF_8.name()));
}
Program: 54590
Project: 54590
Buggy source:
public static void printParamDescriptionFromConfigSchema(Console console,int tabs) throws UnsupportedEncodingException, JsonMappingException {
  ObjectMapper objectMapper=new ObjectMapper();
  ResourceBundle resourceBundle=PropertyResourceBundle.getBundle("String_Node_Str");
  DescriptionFactoryWrapper visitor=new DescriptionFactoryWrapper(resourceBundle,console,tabs);
  objectMapper.acceptJsonFormatVisitor(objectMapper.constructType(Config.class),visitor);
}

Fixed version (ground truth):
public static void printParamDescriptionFromConfigSchema(Console console,int tabs) throws UnsupportedEncodingException, JsonMappingException {
  ObjectMapper objectMapper=new ObjectMapper();
  ResourceBundle resourceBundle=PropertyResourceBundle.getBundle("String_Node_Str");
  DescriptionFactoryWrapper visitor=new DescriptionFactoryWrapper(resourceBundle,console,tabs);
  objectMapper.acceptJsonFormatVisitor(objectMapper.constructType(Config.class),visitor);
  console.println("String_Node_Str");
}
Program: 54591
Project: 54591
Buggy source:
@Inject public TorodbMeta(String databaseName,DSLContext dsl,SQLWrapper sqlWrapper) throws SQLException, IOException, InvalidDatabaseException {
  this.databaseName=databaseName;
  Meta jooqMeta=dsl.meta();
  Connection conn=dsl.configuration().connectionProvider().acquire();
  DatabaseMetaData jdbcMeta=conn.getMetaData();
  collectionSchemes=new MapMaker().concurrencyLevel(1).makeMap();
  TorodbSchema.TORODB.checkOrCreate(dsl,jooqMeta,jdbcMeta);
  loadAllCollectionSchemas(dsl,jooqMeta,jdbcMeta);
  createTypes(conn,jdbcMeta);
  createProcedures(conn,jdbcMeta);
  createCast(conn,jdbcMeta);
  dsl.configuration().connectionProvider().release(conn);
  this.sqlWrapper=sqlWrapper;
}

Fixed version (ground truth):
@Inject public TorodbMeta(String databaseName,DSLContext dsl,SQLWrapper sqlWrapper) throws SQLException, IOException, InvalidDatabaseException {
  this.databaseName=databaseName;
  this.sqlWrapper=sqlWrapper;
  Meta jooqMeta=dsl.meta();
  Connection conn=dsl.configuration().connectionProvider().acquire();
  DatabaseMetaData jdbcMeta=conn.getMetaData();
  collectionSchemes=new MapMaker().concurrencyLevel(1).makeMap();
  TorodbSchema.TORODB.checkOrCreate(dsl,jooqMeta,jdbcMeta);
  loadAllCollectionSchemas(dsl,jooqMeta,jdbcMeta);
  createTypes(conn,jdbcMeta);
  createProcedures(conn,jdbcMeta);
  createCast(conn,jdbcMeta);
  dsl.configuration().connectionProvider().release(conn);
}
Program: 54592
Project: 54592
Buggy source:
@Override public void close(SessionExecutor executor){
  try {
    executor.noop().get();
synchronized (this) {
      closeImmediately(executor);
      closed=true;
    }
  }
 catch (  InterruptedException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  ExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
}

Fixed version (ground truth):
@Override public void close(SessionExecutor executor){
  try {
    executor.noop().get();
synchronized (this) {
      if (!closed) {
        closeImmediately(executor);
        closed=true;
      }
    }
  }
 catch (  InterruptedException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  ExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
}
Program: 54593
Project: 54593
Buggy source:
@Override public List<ToroDocument> read(SessionExecutor executor,int limit) throws ClosedToroCursorException {
  if (limit <= 0) {
    throw new IllegalArgumentException("String_Node_Str" + limit + "String_Node_Str");
  }
  try {
    executor.noop().get();
synchronized (this) {
      if (isClosed()) {
        throw new ClosedToroCursorException();
      }
      List<? extends SplitDocument> splitDocs=executor.readCursor(getId(),limit).get();
      List<ToroDocument> docs=Lists.newArrayListWithCapacity(splitDocs.size());
      for (      SplitDocument splitDocument : splitDocs) {
        docs.add(d2r.translate(splitDocument));
      }
      position+=docs.size();
      if (isAutoclosable() && position == maxElements) {
        close(executor);
      }
      return docs;
    }
  }
 catch (  ToroTaskExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  InterruptedException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  ExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
}

Fixed version (ground truth):
@Override public List<ToroDocument> read(SessionExecutor executor,int limit) throws ClosedToroCursorException {
  if (limit <= 0) {
    throw new IllegalArgumentException("String_Node_Str" + limit + "String_Node_Str");
  }
  limit=Math.min(limit,maxElements - position);
  try {
    executor.noop().get();
synchronized (this) {
      if (isClosed()) {
        throw new ClosedToroCursorException();
      }
      List<? extends SplitDocument> splitDocs=executor.readCursor(getId(),limit).get();
      List<ToroDocument> docs=Lists.newArrayListWithCapacity(splitDocs.size());
      for (      SplitDocument splitDocument : splitDocs) {
        docs.add(d2r.translate(splitDocument));
      }
      position+=docs.size();
      if (isAutoclosable() && position == maxElements) {
        close(executor);
      }
      return docs;
    }
  }
 catch (  ToroTaskExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  InterruptedException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  ExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
}
Program: 54594
Project: 54594
Buggy source:
int reserveDocId(SessionExecutor sessionExecutor,int neededIds){
  int firstFreeId=info.getAndAddLastUsedId(neededIds) + 1;
  Future<?> blocker=reserveMoreIdsIfNeeded(collection,info);
  if (blocker == null) {
    LOGGER.debug("String_Node_Str",neededIds,collection);
  }
 else {
    Long tick=systemExecutor.getTick();
    sessionExecutor.pauseUntil(tick);
    LOGGER.debug("String_Node_Str",neededIds,collection);
  }
  return firstFreeId;
}

Fixed version (ground truth):
int reserveDocId(SessionExecutor sessionExecutor,int neededIds){
  int firstFreeId=info.getAndAddLastUsedId(neededIds) + 1;
  Future<?> blocker=reserveMoreIdsIfNeeded(collection,info);
  if (blocker == null) {
    LOGGER.trace("String_Node_Str",neededIds,collection);
  }
 else {
    Long tick=systemExecutor.getTick();
    sessionExecutor.pauseUntil(tick);
    LOGGER.debug("String_Node_Str",neededIds,collection);
  }
  return firstFreeId;
}
Program: 54595
Project: 54595
Buggy source:
@Override public ToroCursor<ToroDocument> openLimitedCursor(@Nonnull SessionExecutor sessionExecutor,String collection,@Nullable QueryCriteria queryCriteria,@Nullable Projection projection,int numberToSkip,int maxResults,boolean autoclose,boolean hasTimeout){
  CursorId id=consumeId();
  Future<Void> query=sessionExecutor.query(collection,id,queryCriteria,projection,0);
  try {
    query.get();
  }
 catch (  InterruptedException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  ExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
  StandardDocumentToroCursor cursor=new StandardDocumentToroCursor(sessionExecutor,id,hasTimeout,maxResults,autoclose,d2r);
  return storage.storeCursor(cursor,sessionExecutor);
}

Fixed version (ground truth):
@Override public ToroCursor<ToroDocument> openLimitedCursor(@Nonnull SessionExecutor sessionExecutor,String collection,@Nullable QueryCriteria queryCriteria,@Nullable Projection projection,int numberToSkip,int maxResults,boolean autoclose,boolean hasTimeout){
  CursorId id=consumeId();
  Future<Void> query=sessionExecutor.query(collection,id,queryCriteria,projection,maxResults);
  try {
    query.get();
  }
 catch (  InterruptedException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  ExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
  StandardDocumentToroCursor cursor=new StandardDocumentToroCursor(sessionExecutor,id,hasTimeout,maxResults,autoclose,d2r);
  return storage.storeCursor(cursor,sessionExecutor);
}
Program: 54597
Project: 54597
Buggy source:
@Override public PosixPatternValue toValue(String value){
  return new PosixPatternValue(value.substring(1,value.length() - 1));
}

Fixed version (ground truth):
@Override public PosixPatternValue toValue(String value){
  return new PosixPatternValue(value);
}
Program: 54598
Project: 54598
Buggy source:
private String translateValueToJsonb(Value value){
  ValueConverter converter=ValueToJsonbConverterProvider.getInstance().getConverter(value.getType());
  Object translatedObject=converter.toJson(value);
  String result;
  if (value.getType().equals(BasicType.STRING)) {
    result='\"' + translatedObject.toString() + '\"';
  }
 else {
    result=translatedObject.toString();
  }
  return result;
}

Fixed version (ground truth):
private String translateValueToJsonb(Value value){
  ValueConverter converter=ValueToJsonbConverterProvider.getInstance().getConverter(value.getType());
  Object translatedObject=converter.toJson(value);
  String result;
  if (translatedObject instanceof String) {
    result='\"' + (String)translatedObject + '\"';
  }
 else {
    result=translatedObject.toString();
  }
  return result;
}
Program: 54599
Project: 54599
Buggy source:
@Override protected void queryNamespaces(QueryMessage queryMessage,MessageReplier messageReplier) throws ImplementationDbException {
  AttributeMap attributeMap=messageReplier.getAttributeMap();
  ToroConnection connection=attributeMap.attr(ToroRequestProcessor.CONNECTION).get();
  Collection<String> allCollections=connection.getCollections();
  List<ToroDocument> candidates=Lists.newArrayList();
  ToroTransaction transaction=connection.createTransaction();
  try {
    for (    String collection : allCollections) {
      String collectionNamespace=databaseName + '.' + collection;
      candidates.add(new KVToroDocument(new ObjectValue.Builder().putValue(collection,collectionNamespace).build()));
      Collection<? extends NamedToroIndex> indexes=transaction.getIndexes(collection);
      for (      NamedToroIndex index : indexes) {
        candidates.add(new KVToroDocument(new ObjectValue.Builder().putValue("String_Node_Str",collectionNamespace + '.' + index.getName()).build()));
      }
    }
    candidates.add(new KVToroDocument(new ObjectValue.Builder().putValue("String_Node_Str",databaseName + "String_Node_Str").build()));
  }
  finally {
    transaction.close();
  }
  QueryCriteria queryCriteria=Util.translateQuery(queryMessage.getDocument());
  Collection<ToroDocument> filtrered=applyQueryCriteria(candidates,queryCriteria);
  BSONDocuments docs=new BSONDocuments(filtrered);
  messageReplier.replyMessageNoCursor(docs);
}

Fixed version (ground truth):
@Override protected void queryNamespaces(QueryMessage queryMessage,MessageReplier messageReplier) throws ImplementationDbException {
  AttributeMap attributeMap=messageReplier.getAttributeMap();
  ToroConnection connection=attributeMap.attr(ToroRequestProcessor.CONNECTION).get();
  Collection<String> allCollections=connection.getCollections();
  List<ToroDocument> candidates=Lists.newArrayList();
  ToroTransaction transaction=connection.createTransaction();
  try {
    for (    String collection : allCollections) {
      String collectionNamespace=databaseName + '.' + collection;
      candidates.add(new KVToroDocument(new ObjectValue.Builder().putValue("String_Node_Str",collectionNamespace).build()));
      Collection<? extends NamedToroIndex> indexes=transaction.getIndexes(collection);
      for (      NamedToroIndex index : indexes) {
        candidates.add(new KVToroDocument(new ObjectValue.Builder().putValue("String_Node_Str",collectionNamespace + '.' + index.getName()).build()));
      }
    }
    candidates.add(new KVToroDocument(new ObjectValue.Builder().putValue("String_Node_Str",databaseName + "String_Node_Str").build()));
  }
  finally {
    transaction.close();
  }
  QueryCriteria queryCriteria=Util.translateQuery(queryMessage.getDocument());
  Collection<ToroDocument> filtrered=applyQueryCriteria(candidates,queryCriteria);
  BSONDocuments docs=new BSONDocuments(filtrered);
  messageReplier.replyMessageNoCursor(docs);
}
Program: 54600
Project: 54600
Buggy source:
public Builder putValue(String key,DocValue value){
  checkNewBuild();
  if (value instanceof ObjectValue) {
    newObject(key).copy((ObjectValue)value);
  }
 else {
    if (value instanceof ArrayValue) {
      newArray(key).copy((ArrayValue)value);
    }
 else {
      values.put(key,value);
      subArrayBuilders.remove(key);
      subObjectBuilders.remove(key);
    }
  }
  return this;
}

Fixed version (ground truth):
public Builder putValue(String key,ArrayValue.Builder value){
  return putValue(key,value.build());
}
Program: 54601
Project: 54601
Buggy source:
public DropCollectionCallable(DbConnection connection,TransactionAborter abortCallback,Report report,String collection){
  super(connection,abortCallback);
  this.report=report;
  this.collection=collection;
}

Fixed version (ground truth):
public DropCollectionCallable(DbWrapper dbWrapperPool,String collection,Report report){
  super(dbWrapperPool);
  this.report=report;
  this.collection=collection;
}
Program: 54602
Project: 54602
Buggy source:
public Collection<String> getAttributes(){
  return attributes;
}

Fixed version (ground truth):
public Set<String> getAttributes(){
  return attributes;
}
Program: 54603
Project: 54603
Buggy source:
public static void execute(Configuration jooqConf,CollectionSchema colSchema){
  DSLContext dsl=DSL.using(jooqConf);
  for (  SubDocTable subDocTable : colSchema.getSubDocTables()) {
    deleteAll(dsl,subDocTable);
  }
  Table<Record> rootTable=DSL.tableByName(colSchema.getName(),"String_Node_Str");
  deleteAll(dsl,rootTable);
}

Fixed version (ground truth):
@SuppressFBWarnings("String_Node_Str") public static void execute(Configuration jooqConf,CollectionSchema colSchema){
  ConnectionProvider provider=jooqConf.connectionProvider();
  Connection connection=provider.acquire();
  Statement st=null;
  try {
    st=connection.createStatement();
    st.executeUpdate("String_Node_Str" + colSchema.getName() + "String_Node_Str");
  }
 catch (  SQLException ex) {
    throw new ToroImplementationException(ex);
  }
 finally {
    AutoCloser.close(st);
  }
}
Program: 54604
Project: 54604
Buggy source:
@Override public void dropCollection(String collection){
  CollectionSchema colSchema=meta.getCollectionSchema(collection);
  Routines.dropCollection(jooqConf,colSchema);
}

Fixed version (ground truth):
@Override public void dropCollection(String collection){
  CollectionSchema colSchema=meta.getCollectionSchema(collection);
  Routines.dropCollection(jooqConf,colSchema);
  meta.dropCollectionSchema(collection);
}
Program: 54605
Project: 54605
Buggy source:
@Nullable private DocValue resolve(Iterator<AttributeReference.Key> atts,ArrayValue value){
  if (!atts.hasNext()) {
    return value;
  }
 else {
    AttributeReference.Key nextAtt=atts.next();
    if (!(nextAtt instanceof AttributeReference.ArrayKey)) {
      return null;
    }
 else {
      DocValue referencedValue=value.get(((AttributeReference.ArrayKey)nextAtt).getKeyValue());
      if (!atts.hasNext()) {
        return referencedValue;
      }
      if (referencedValue instanceof ObjectValue) {
        return resolve(atts,(ObjectValue)referencedValue);
      }
      if (referencedValue instanceof ArrayValue) {
        return resolve(atts,(ArrayValue)referencedValue);
      }
 else {
        return null;
      }
    }
  }
}

Fixed version (ground truth):
@Nullable private DocValue resolve(Iterator<AttributeReference.Key> atts,ArrayValue value){
  if (!atts.hasNext()) {
    return value;
  }
 else {
    AttributeReference.Key nextAtt=atts.next();
    if (!(nextAtt instanceof AttributeReference.ArrayKey)) {
      return null;
    }
 else {
      AttributeReference.ArrayKey castedAtt=(AttributeReference.ArrayKey)nextAtt;
      if (castedAtt.getIndex() < 0) {
        return null;
      }
      if (castedAtt.getIndex() >= value.size()) {
        return null;
      }
      DocValue referencedValue=value.get(castedAtt.getKeyValue());
      if (!atts.hasNext()) {
        return referencedValue;
      }
      if (referencedValue instanceof ObjectValue) {
        return resolve(atts,(ObjectValue)referencedValue);
      }
      if (referencedValue instanceof ArrayValue) {
        return resolve(atts,(ArrayValue)referencedValue);
      }
 else {
        return null;
      }
    }
  }
}
Program: 54607
Project: 54607
Buggy source:
@Override protected void configure(){
  bind(RequestProcessor.class).to(ToroRequestProcessor.class);
  bind(BuildProperties.class).asEagerSingleton();
  bind(QueryCommandProcessor.class).to(ToroQueryCommandProcessor.class);
}

Fixed version (ground truth):
@Override protected void configure(){
  bind(RequestProcessor.class).to(ToroRequestProcessor.class);
  bind(BuildProperties.class).asEagerSingleton();
  bind(QueryCommandProcessor.class).to(ToroQueryCommandProcessor.class);
  bind(MetaQueryProcessor.class).to(ToroMetaQueryProcessor.class).in(Singleton.class);
}
Program: 54608
Project: 54608
Buggy source:
@Override public ToroTransaction createTransaction() throws ImplementationDbException {
  SessionTransaction sessionTransaction=executor.createTransaction();
  return new DefaultToroTransaction(session,sessionTransaction,d2r,executor,documentBuilderFactory,cursorManager,cache);
}

Fixed version (ground truth):
@Override public ToroTransaction createTransaction() throws ImplementationDbException {
  SessionTransaction sessionTransaction=executor.createTransaction();
  return new DefaultToroTransaction(session,sessionTransaction,d2r,executor,documentBuilderFactory,cursorManager);
}
Program: 54609
Project: 54609
Buggy source:
@Override public Collection<? extends NamedToroIndex> getIndexes(){
  return cache.getIndexes();
}

Fixed version (ground truth):
@Override public Collection<? extends NamedToroIndex> getIndexes(String collection){
  try {
    return sessionTransaction.getIndexes(collection).get();
  }
 catch (  InterruptedException ex) {
    throw new ToroRuntimeException(ex);
  }
catch (  ExecutionException ex) {
    throw new ToroRuntimeException(ex);
  }
}
Program: 54610
Project: 54610
Buggy source:
@Override public Future<NamedToroIndex> createIndex(String indexName,IndexedAttributes attributes,boolean unique,boolean blocking){
  return cache.createIndex(indexName,attributes,unique,blocking);
}

Fixed version (ground truth):
@Override public Future<NamedToroIndex> createIndex(String collection,String indexName,IndexedAttributes attributes,boolean unique,boolean blocking){
  return sessionTransaction.createIndex(collection,indexName,attributes,unique,blocking);
}
Program: 54611
Project: 54611
Buggy source:
DefaultToroTransaction(Session session,SessionTransaction sessionTransaction,D2RTranslator d2r,SessionExecutor executor,DocumentBuilderFactory documentBuilderFactory,CursorManager cursorManager,DbMetaInformationCache cache){
  this.sessionTransaction=sessionTransaction;
  this.d2r=d2r;
  this.executor=executor;
  this.documentBuilderFactory=documentBuilderFactory;
  this.cursorManager=cursorManager;
  this.cache=cache;
}

Fixed version (ground truth):
DefaultToroTransaction(Session session,SessionTransaction sessionTransaction,D2RTranslator d2r,SessionExecutor executor,DocumentBuilderFactory documentBuilderFactory,CursorManager cursorManager){
  this.sessionTransaction=sessionTransaction;
  this.d2r=d2r;
  this.executor=executor;
  this.documentBuilderFactory=documentBuilderFactory;
  this.cursorManager=cursorManager;
}
Program: 54612
Project: 54612
Buggy source:
@Override public Future<Boolean> dropIndex(String indexName){
  return cache.dropIndex(indexName);
}

Fixed version (ground truth):
@Override public Future<Boolean> dropIndex(String collection,String indexName){
  return sessionTransaction.dropIndex(collection,indexName);
}
Program: 54613
Project: 54613
Buggy source:
@Override public <R>R catchSystemException(Throwable t,Callable<R> task) throws Exception {
  Logger.getLogger(DefaultExceptionHandler.class.getName()).log(Level.SEVERE,null,t);
  return null;
}

Fixed version (ground truth):
@Override public <R>R catchSystemException(Throwable t,Callable<R> task) throws Exception {
  LOGGER.error("String_Node_Str",t);
  throw new ToroImplementationException(t);
}
Program: 54614
Project: 54614
Buggy source:
@Override public <R>R catchSessionException(Throwable t,Callable<R> task,Session s) throws Exception {
  Logger.getLogger(DefaultExceptionHandler.class.getName()).log(Level.SEVERE,null,t);
  return null;
}

Fixed version (ground truth):
@Override public <R>R catchSessionException(Throwable t,Callable<R> task,Session s) throws Exception {
  LOGGER.error("String_Node_Str",t);
  throw new UserToroException(t);
}
Program: 54615
Project: 54615
Buggy source:
@Override public Future<List<? extends SplitDocument>> readAllCursor(CursorId cursorId) throws ToroTaskExecutionException {
  return submit(new ReadAllCursorCallable(wrapper,cursorId,reportFactory.createReadAllCursorReport()));
}

Fixed version (ground truth):
@Override public Future<List<? extends SplitDocument>> readAllCursor(CursorId cursorId) throws ToroTaskExecutionException {
  return submit(new ReadAllCursorCallable(wrapper,reportFactory.createReadAllCursorReport(),cursorId));
}
Program: 54616
Project: 54616
Buggy source:
protected <R>Future<R> submit(Callable<R> callable){
  return executorService.submit(new DefaultSessionExecutor.SessionRunnable(callable));
}

Fixed version (ground truth):
protected <R>Future<R> submit(Job<R> job){
  return executorService.submit(new DefaultSessionExecutor.SessionRunnable(job));
}
Program: 54617
Project: 54617
Buggy source:
@Override public Future<List<? extends Database>> getDatabases(){
  return submit(new GetDatabasesCallable(wrapper,databaseName));
}

Fixed version (ground truth):
@Override public Future<List<? extends Database>> getDatabases(){
  return submit(new GetDatabasesCallable(wrapper,reportFactory.createGetDatabasesReport(),databaseName));
}
Program: 54618
Project: 54618
Buggy source:
@Override public Future<Integer> countRemainingDocs(CursorId cursorId){
  return submit(new CountRemainingDocs(wrapper,cursorId,reportFactory.createCountRemainingDocsReport()));
}

Fixed version (ground truth):
@Override public Future<Integer> countRemainingDocs(CursorId cursorId){
  return submit(new CountRemainingDocsCallable(wrapper,reportFactory.createCountRemainingDocsReport(),cursorId));
}
Program: 54619
Project: 54619
Buggy source:
@Override public Future<Void> query(String collection,CursorId cursorId,QueryCriteria filter,Projection projection,int maxResults){
  return submit(new QueryCallable(wrapper,collection,cursorId,filter,projection,maxResults,reportFactory.createQueryReport()));
}

Fixed version (ground truth):
@Override public Future<Void> query(String collection,CursorId cursorId,QueryCriteria filter,Projection projection,int maxResults){
  return submit(new QueryCallable(wrapper,reportFactory.createQueryReport(),collection,cursorId,filter,projection,maxResults));
}
Program: 54620
Project: 54620
Buggy source:
public SessionRunnable(Callable<R> delegate){
  this.delegate=delegate;
}

Fixed version (ground truth):
public SessionRunnable(Job<R> delegate){
  this.delegate=delegate;
}
Program: 54621
Project: 54621
Buggy source:
@Inject public DefaultSessionExecutor(ExceptionHandler exceptionHandler,DbWrapper wrapper,ExecutorServiceProvider executorServiceProvider,Monitor monitor,Session session,ReportFactory reportFactory,@DatabaseName String databaseName){
  this.executorServiceProvider=executorServiceProvider;
  this.exceptionHandler=exceptionHandler;
  this.wrapper=wrapper;
  this.executorService=executorServiceProvider.consumeSessionExecutorService(session);
  this.monitor=monitor;
  this.session=session;
  this.reportFactory=reportFactory;
  this.databaseName=databaseName;
}

Fixed version (ground truth):
@Inject public DefaultSessionExecutor(ExceptionHandler exceptionHandler,DbWrapper wrapper,ExecutorServiceProvider executorServiceProvider,Monitor monitor,Session session,ReportFactory reportFactory,@DatabaseName String databaseName){
  this.executorServiceProvider=executorServiceProvider;
  this.exceptionHandler=exceptionHandler;
  this.wrapper=new LazyDbWrapper(wrapper);
  this.executorService=executorServiceProvider.consumeSessionExecutorService(session);
  this.monitor=monitor;
  this.session=session;
  this.reportFactory=reportFactory;
  this.databaseName=databaseName;
}
Program: 54622
Project: 54622
Buggy source:
@Override public Future<List<? extends SplitDocument>> readCursor(CursorId cursorId,int limit) throws ToroTaskExecutionException {
  return submit(new ReadCursorCallable(wrapper,cursorId,limit,reportFactory.createReadCursorReport()));
}

Fixed version (ground truth):
@Override public Future<List<? extends SplitDocument>> readCursor(CursorId cursorId,int limit) throws ToroTaskExecutionException {
  return submit(new ReadCursorCallable(wrapper,reportFactory.createReadCursorReport(),cursorId,limit));
}
Program: 54623
Project: 54623
Buggy source:
@Override public SessionTransaction createTransaction() throws ImplementationDbException {
  return new DefaultSessionTransaction(this,wrapper,reportFactory);
}

Fixed version (ground truth):
@Override public SessionTransaction createTransaction() throws ImplementationDbException {
  return new DefaultSessionTransaction(this,wrapper.consumeSessionDbConnection(),reportFactory);
}