nus-yam/ex-repair huggingface dataset:
Program: 26783
Project: 26783
Buggy source:
public ManyToManyDefinition(TypeElement element,ProcessorManager processorManager){
  super(element,processorManager);
  ManyToMany manyToMany=element.getAnnotation(ManyToMany.class);
  referencedTable=TypeName.get(ModelUtils.getReferencedClassFromAnnotation(manyToMany));
  generateAutoIncrement=manyToMany.generateAutoIncrement();
  generatedTableClassName=manyToMany.generatedTableClassName();
  saveForeignKeyModels=manyToMany.saveForeignKeyModels();
  sameTableReferenced=(referencedTable.equals(elementTypeName));
  Table table=element.getAnnotation(Table.class);
  try {
    table.database();
  }
 catch (  MirroredTypeException mte) {
    databaseTypeName=TypeName.get(mte.getTypeMirror());
  }
  DatabaseDefinition databaseDefinition=manager.getDatabaseHolderDefinition(databaseTypeName).getDatabaseDefinition();
  if (databaseDefinition == null) {
    manager.logError("String_Node_Str" + elementName);
  }
 else {
    if (StringUtils.isNullOrEmpty(generatedTableClassName)) {
      ClassName referencedOutput=getElementClassName(manager.getElements().getTypeElement(referencedTable.toString()));
      setOutputClassName(databaseDefinition.classSeparator + referencedOutput.simpleName());
    }
 else {
      setOutputClassNameFull(generatedTableClassName);
    }
  }
}

Fixed version (ground truth):
public ManyToManyDefinition(TypeElement element,ProcessorManager processorManager){
  super(element,processorManager);
  ManyToMany manyToMany=element.getAnnotation(ManyToMany.class);
  referencedTable=TypeName.get(ModelUtils.getReferencedClassFromAnnotation(manyToMany));
  generateAutoIncrement=manyToMany.generateAutoIncrement();
  generatedTableClassName=manyToMany.generatedTableClassName();
  saveForeignKeyModels=manyToMany.saveForeignKeyModels();
  sameTableReferenced=(referencedTable.equals(elementTypeName));
  Table table=element.getAnnotation(Table.class);
  try {
    table.database();
  }
 catch (  MirroredTypeException mte) {
    databaseTypeName=TypeName.get(mte.getTypeMirror());
  }
}
Program: 26784
Project: 26784
Buggy source:
public void addManyToManyDefinition(ManyToManyDefinition manyToManyDefinition){
  DatabaseHolderDefinition databaseHolderDefinition=getOrPutDatabase(manyToManyDefinition.databaseTypeName);
  databaseHolderDefinition.manyToManyDefinitionMap.put(manyToManyDefinition.elementClassName,manyToManyDefinition);
  if (databaseHolderDefinition.manyToManyDefinitionMap.containsKey(manyToManyDefinition.outputClassName)) {
    logError("String_Node_Str",manyToManyDefinition.outputClassName,manyToManyDefinition.databaseTypeName);
  }
 else {
    databaseHolderDefinition.manyToManyDefinitionMap.put(manyToManyDefinition.outputClassName,manyToManyDefinition);
  }
}

Fixed version (ground truth):
public void addManyToManyDefinition(ManyToManyDefinition manyToManyDefinition){
  DatabaseHolderDefinition databaseHolderDefinition=getOrPutDatabase(manyToManyDefinition.databaseTypeName);
  if (databaseHolderDefinition.manyToManyDefinitionMap.containsKey(manyToManyDefinition.elementClassName)) {
    logError("String_Node_Str",manyToManyDefinition.elementClassName,manyToManyDefinition.databaseTypeName);
  }
 else {
    databaseHolderDefinition.manyToManyDefinitionMap.put(manyToManyDefinition.elementClassName,manyToManyDefinition);
  }
}
Program: 26786
Project: 26786
Buggy source:
/** 
 * @return The name used in queries. If an alias is specified, use that, otherwise use the nameof the property with a table name (if specified).
 */
@Override public String getQuery(){
  if (StringUtils.isNotNullOrEmpty(aliasName)) {
    return aliasName();
  }
 else {
    return fullName();
  }
}

Fixed version (ground truth):
/** 
 * @return The name used in queries. If an alias is specified, use that, otherwise use the nameof the property with a table name (if specified).
 */
@Override public String getQuery(){
  if (StringUtils.isNotNullOrEmpty(aliasName)) {
    return aliasName();
  }
 else   if (StringUtils.isNotNullOrEmpty(name)) {
    return fullName();
  }
 else {
    return "String_Node_Str";
  }
}
Program: 26788
Project: 26788
Buggy source:
CodeBlock getForeignKeyContainerMethod(ClassName tableClassName){
  String access=getShortColumnAccess(false,false,tableColumnAccess.getShortAccessString(foreignKeyColumnDefinition.elementClassName,foreignKeyFieldName,false,false));
  if (foreignKeyColumnDefinition.isModelContainer) {
    access=foreignKeyColumnDefinition.getColumnAccessString(false,false) + "String_Node_Str" + access;
  }
  CodeBlock.Builder codeBuilder=CodeBlock.builder();
  codeBuilder.addStatement("String_Node_Str",ModelUtils.getVariable(true),tableClassName,columnName,access);
  return codeBuilder.build();
}

Fixed version (ground truth):
CodeBlock getForeignKeyContainerMethod(ClassName tableClassName){
  String access=getShortColumnAccess(false,false,tableColumnAccess.getShortAccessString(foreignKeyColumnDefinition.elementClassName,foreignKeyFieldName,false,false));
  if (foreignKeyColumnDefinition.isModelContainer) {
    access=foreignKeyColumnDefinition.getColumnAccessString(false,false) + "String_Node_Str" + access;
  }
 else   if (foreignKeyColumnDefinition.isModel && !isReferencedFieldPackagePrivate) {
    access=foreignKeyColumnDefinition.getColumnAccessString(false,false) + "String_Node_Str" + access;
  }
  CodeBlock.Builder codeBuilder=CodeBlock.builder();
  codeBuilder.addStatement("String_Node_Str",ModelUtils.getVariable(true),tableClassName,columnName,access);
  return codeBuilder.build();
}
Program: 26789
Project: 26789
Buggy source:
@Test public void testTableList(){
  List<ListModel> testModel1s=GenerationUtils.generateRandomModels(ListModel.class,100);
  assertTrue(modelList.size() == 100);
  assertTrue(modelList.containsAll(testModel1s));
  ListModel model1=modelList.remove(0);
  assertTrue(modelList.size() == 99);
  assertTrue(modelList.add(model1));
  assertTrue(modelList.size() == 100);
  modelList.set(model1);
  modelList.clear();
  assertTrue(modelList.size() == 0);
}

Fixed version (ground truth):
@Test public void testTableList(){
  List<ListModel> testModel1s=GenerationUtils.generateRandomModels(ListModel.class,100);
  modelList=new FlowQueryList<>(SQLite.select().from(ListModel.class));
  assertTrue(modelList.size() == 100);
  assertTrue(modelList.containsAll(testModel1s));
  ListModel model1=modelList.remove(0);
  assertTrue(modelList.size() == 99);
  assertTrue(modelList.add(model1));
  assertTrue(modelList.size() == 100);
  modelList.set(model1);
  modelList.clear();
  assertTrue(modelList.size() == 0);
}
Program: 26790
Project: 26790
Buggy source:
/** 
 * Tests to ensure the model view operates as expected
 */
@Test public void testModelView(){
  TestModel2 testModel2=new TestModel2();
  testModel2.order=6;
  testModel2.name="String_Node_Str";
  testModel2.save();
  testModel2=new TestModel2();
  testModel2.order=5;
  testModel2.name="String_Node_Str";
  testModel2.save();
  List<TestModelView> testModelViews=new Select().from(TestModelView.class).queryList();
  assertTrue(!testModelViews.isEmpty());
  assertTrue(testModelViews.size() == 1);
  FlowCursorList<TestModelView> list=new FlowCursorList<>(true,TestModelView.class);
  assertNotNull(list.getItem(0));
}

Fixed version (ground truth):
/** 
 * Tests to ensure the model view operates as expected
 */
@Test public void testModelView(){
  TestModel2 testModel2=new TestModel2();
  testModel2.order=6;
  testModel2.name="String_Node_Str";
  testModel2.save();
  testModel2=new TestModel2();
  testModel2.order=5;
  testModel2.name="String_Node_Str";
  testModel2.save();
  List<TestModelView> testModelViews=new Select().from(TestModelView.class).queryList();
  assertTrue(!testModelViews.isEmpty());
  assertTrue(testModelViews.size() == 1);
  FlowCursorList<TestModelView> list=new FlowCursorList<>(SQLite.select().from(TestModelView.class));
  assertNotNull(list.getItem(0));
}
Program: 26791
Project: 26791
Buggy source:
/** 
 * Constructs an instance of this list.
 * @param cacheModels    For every call to {@link #getItem(long)}, we want to keep a reference to it so we do not need to convert the cursor data back into a   {@link TModel} again.
 * @param modelQueriable The SQL where query to use when doing a query.
 */
public FlowCursorList(boolean cacheModels,ModelQueriable<TModel> modelQueriable){
  this.modelQueriable=modelQueriable;
  cursor=this.modelQueriable.query();
  table=modelQueriable.getTable();
  modelAdapter=FlowManager.getModelAdapter(table);
  this.cacheModels=cacheModels;
  setCacheModels(cacheModels);
}

Fixed version (ground truth):
/** 
 * Constructs an instance of this list.
 * @param cacheModels    For every call to {@link #getItem(long)}, we want to keep a reference to it so we do not need to convert the cursor data back into a   {@link TModel} again.
 * @param modelQueriable The SQL where query to use when doing a query.
 */
public FlowCursorList(boolean cacheModels,ModelQueriable<TModel> modelQueriable){
  this.modelQueriable=modelQueriable;
  cursor=this.modelQueriable.query();
  table=modelQueriable.getTable();
  modelAdapter=FlowManager.getInstanceAdapter(table);
  this.cacheModels=cacheModels;
  setCacheModels(cacheModels);
}
Program: 26792
Project: 26792
Buggy source:
/** 
 * Will refresh content at a slightly later time, and multiple subsequent calls to this method within a short period of time will be combined into one call.
 */
public void refreshAsync(){
synchronized (this) {
    if (pendingRefresh) {
      return;
    }
    pendingRefresh=true;
  }
  REFRESH_gitHANDLER.post(refreshRunnable);
}

Fixed version (ground truth):
/** 
 * Will refresh content at a slightly later time, and multiple subsequent calls to this method within a short period of time will be combined into one call.
 */
public void refreshAsync(){
synchronized (this) {
    if (pendingRefresh) {
      return;
    }
    pendingRefresh=true;
  }
  REFRESH_HANDLER.post(refreshRunnable);
}
Program: 26793
Project: 26793
Buggy source:
/** 
 * @return The first {@link TModel} of items from the contained {@link Cursor}. You must call   {@link #close()} when finished.
 */
@Nullable public TModel toModel(){
}

Fixed version (ground truth):
/** 
 * @return The first {@link TModel} of items from the contained {@link Cursor}. You must call   {@link #close()} when finished.
 */
@Nullable public TModel toModel(){
  if (cursor != null) {
    return retrievalAdapter.getSingleModelLoader().convertToData(cursor,null);
  }
 else {
    return null;
  }
}
Program: 26794
Project: 26794
Buggy source:
/** 
 * @return A {@link List} of items from this object. You must call {@link #close()} when finished.
 */
@Nullable public <TCustom extends BaseQueryModel>List<TCustom> toCustomList(Class<TCustom> customClass){
}

Fixed version (ground truth):
/** 
 * @return A {@link List} of items from this object. You must call {@link #close()} when finished.
 */
@Nullable public <TCustom extends BaseQueryModel>List<TCustom> toCustomList(Class<TCustom> customClass){
  if (cursor != null) {
    return FlowManager.getQueryModelAdapter(customClass).getListModelLoader().convertToData(cursor,null);
  }
 else {
    return null;
  }
}
Program: 26795
Project: 26795
Buggy source:
/** 
 * @return A {@link List} of items from this object. You must call {@link #close()} when finished.
 */
@Nullable public List<TModel> toList(){
}

Fixed version (ground truth):
/** 
 * @return A {@link List} of items from this object. You must call {@link #close()} when finished.
 */
@Nullable public List<TModel> toList(){
  if (cursor != null) {
    return retrievalAdapter.getListModelLoader().convertToData(cursor,null);
  }
 else {
    return null;
  }
}
Program: 26796
Project: 26796
Buggy source:
@Override public ModelContainer<TModel,?> convertToData(@NonNull Cursor cursor,@Nullable ModelContainer<TModel,?> data,boolean moveToFirst){
  if (data != null) {
    if (cursor.moveToFirst()) {
      modelContainerAdapter.loadFromCursor(cursor,data);
    }
    return data;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
@Override public ModelContainer<TModel,?> convertToData(@NonNull Cursor cursor,@Nullable ModelContainer<TModel,?> data){
  if (data != null) {
    if (cursor.moveToFirst()) {
      modelContainerAdapter.loadFromCursor(cursor,data);
    }
    return data;
  }
 else {
    return null;
  }
}
Program: 26797
Project: 26797
Buggy source:
/** 
 * Constructs an instance of this list with the specfied   {@link ModelQueriable} object.
 * @param modelQueriable The object that can query from a database.
 */
public FlowQueryList(ModelQueriable<TModel> modelQueriable){
  super(null);
  internalCursorList=new FlowCursorList<TModel>(transact,modelQueriable){
    @Override protected ModelCache<TModel,?> getBackingCache(){
      return FlowQueryList.this.getBackingCache(getCacheSize());
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Constructs an instance of this list with the specfied   {@link ModelQueriable} object.
 * @param modelQueriable The object that can query from a database.
 */
public FlowQueryList(ModelQueriable<TModel> modelQueriable){
  super(null);
  internalCursorList=new FlowCursorList<TModel>(true,modelQueriable){
    @Override protected ModelCache<TModel,?> getBackingCache(){
      return FlowQueryList.this.getBackingCache(getCacheSize());
    }
  }
;
}
Program: 26799
Project: 26799
Buggy source:
public ContainerKeyDefinition(Element element,ProcessorManager processorManager,BaseTableDefinition baseTableDefinition,boolean isPackagePrivate){
  super(element,processorManager);
  ContainerKey containerKey=element.getAnnotation(ContainerKey.class);
  if (containerKey != null) {
    containerKeyName=containerKey.value();
    if (StringUtils.isNullOrEmpty(containerKeyName)) {
      containerKeyName=elementName;
    }
  }
 else {
    containerKeyName=elementName;
  }
  if (isPackagePrivate) {
    columnAccess=PackagePrivateAccess.from(processorManager,element,baseTableDefinition.databaseDefinition.fieldRefSeparator);
    PackagePrivateAccess.putElement(((PackagePrivateAccess)columnAccess).helperClassName,this.containerKeyName);
  }
 else {
    boolean isPrivate=element.getModifiers().contains(Modifier.PRIVATE);
    if (isPrivate) {
      boolean useIs=elementTypeName.box().equals(TypeName.BOOLEAN.box()) && (baseTableDefinition instanceof TableDefinition) && ((TableDefinition)baseTableDefinition).useIsForPrivateBooleans;
      columnAccess=new PrivateColumnAccess(useIs);
    }
 else {
      columnAccess=new SimpleColumnAccess();
    }
  }
}

Fixed version (ground truth):
public ContainerKeyDefinition(Element element,ProcessorManager processorManager,BaseTableDefinition baseTableDefinition,boolean isPackagePrivate){
  super(element,processorManager);
  ContainerKey containerKey=element.getAnnotation(ContainerKey.class);
  if (containerKey != null) {
    containerKeyName=containerKey.value();
    if (StringUtils.isNullOrEmpty(containerKeyName)) {
      containerKeyName=elementName;
    }
  }
 else {
    containerKeyName=elementName;
  }
  if (isPackagePrivate) {
    columnAccess=PackagePrivateAccess.from(processorManager,element,baseTableDefinition.databaseDefinition.classSeparator);
    PackagePrivateAccess.putElement(((PackagePrivateAccess)columnAccess).helperClassName,this.containerKeyName);
  }
 else {
    boolean isPrivate=element.getModifiers().contains(Modifier.PRIVATE);
    if (isPrivate) {
      boolean useIs=elementTypeName.box().equals(TypeName.BOOLEAN.box()) && (baseTableDefinition instanceof TableDefinition) && ((TableDefinition)baseTableDefinition).useIsForPrivateBooleans;
      columnAccess=new PrivateColumnAccess(useIs);
    }
 else {
      columnAccess=new SimpleColumnAccess();
    }
  }
}
Program: 26800
Project: 26800
Buggy source:
@Override public BaseTransactionManager createManager(DatabaseDefinition databaseDefinition){
  if (testTransactionManager == null) {
    testTransactionManager=new TestTransactionManager(databaseDefinition);
  }
  return testTransactionManager;
}

Fixed version (ground truth):
@Override public BaseTransactionManager createManager(DatabaseDefinition databaseDefinition){
  testTransactionManager=new TestTransactionManager(databaseDefinition);
  return testTransactionManager;
}
Program: 26801
Project: 26801
Buggy source:
/** 
 * Returns the associated   {@link ModelAdapter} within this database forthe specified table. If the Model is missing the  {@link com.raizlabs.android.dbflow.annotation.Table} annotation,this will return null.
 * @param table The model that exists in this database.
 * @return The ModelAdapter for the table.
 */
public ModelAdapter getModelAdapterForTable(Class<? extends Model> table){
  return modelAdapters.get(table);
}

Fixed version (ground truth):
/** 
 * Returns the associated   {@link ModelAdapter} within this database forthe specified table. If the Model is missing the  {@link Table} annotation,this will return null.
 * @param table The model that exists in this database.
 * @return The ModelAdapter for the table.
 */
public ModelAdapter getModelAdapterForTable(Class<? extends Model> table){
  return modelAdapters.get(table);
}
Program: 26802
Project: 26802
Buggy source:
/** 
 * @param tableName The name of the table in this db.
 * @return The associated {@link ModelAdapter} within this database for the specified table name.If the Model is missing the  {@link com.raizlabs.android.dbflow.annotation.Table} annotation, this will return null.
 */
public Class<? extends Model> getModelClassForName(String tableName){
  return modelTableNames.get(tableName);
}

Fixed version (ground truth):
/** 
 * @param tableName The name of the table in this db.
 * @return The associated {@link ModelAdapter} within this database for the specified table name.If the Model is missing the  {@link Table} annotation, this will return null.
 */
public Class<? extends Model> getModelClassForName(String tableName){
  return modelTableNames.get(tableName);
}
Program: 26803
Project: 26803
Buggy source:
@Override public void run(){
  successCallback.onSuccess(Transaction.this);
}

Fixed version (ground truth):
@Override public void run(){
  errorCallback.onError(Transaction.this,throwable);
}
Program: 26804
Project: 26804
Buggy source:
/** 
 * Executes the transaction immediately on the same thread from which it is called. This calls the   {@link DatabaseDefinition#executeTransaction(ITransaction)} method, which runs the{@link #transaction()} in a database transaction.
 */
public void executeSync(){
  try {
    if (shouldRunInTransaction) {
      databaseDefinition.executeTransaction(transaction);
    }
 else {
      transaction.execute(databaseDefinition.getWritableDatabase());
    }
    if (successCallback != null) {
      TRANSACTION_HANDLER.post(new Runnable(){
        @Override public void run(){
          successCallback.onSuccess(Transaction.this);
        }
      }
);
    }
  }
 catch (  Throwable throwable) {
    if (errorCallback != null) {
      errorCallback.onError(this,throwable);
    }
  }
}

Fixed version (ground truth):
/** 
 * Executes the transaction immediately on the same thread from which it is called. This calls the   {@link DatabaseDefinition#executeTransaction(ITransaction)} method, which runs the{@link #transaction()} in a database transaction.
 */
public void executeSync(){
  try {
    if (shouldRunInTransaction) {
      databaseDefinition.executeTransaction(transaction);
    }
 else {
      transaction.execute(databaseDefinition.getWritableDatabase());
    }
    if (successCallback != null) {
      TRANSACTION_HANDLER.post(new Runnable(){
        @Override public void run(){
          successCallback.onSuccess(Transaction.this);
        }
      }
);
    }
  }
 catch (  final Throwable throwable) {
    if (errorCallback != null) {
      TRANSACTION_HANDLER.post(new Runnable(){
        @Override public void run(){
          errorCallback.onError(Transaction.this,throwable);
        }
      }
);
    }
  }
}
Program: 26805
Project: 26805
Buggy source:
/** 
 * Loading the module Database holder via reflection. This will trigger all creations, updates, and instantiation for each database defined. <p/> It is assumed FlowManager.init() is called by the application that uses the module database. This method should only be called if you need to load databases that are part of a module. Building once will give you the ability to add the class.
 */
public static void initModule(Class<? extends DatabaseHolder> generatedClassName){
  loadDatabaseHolder(generatedClassName);
}

Fixed version (ground truth):
/** 
 * Loading the module Database holder via reflection. This will trigger all creations, updates, and instantiation for each database defined. <p> It is assumed FlowManager.init() is called by the application that uses the module database. This method should only be called if you need to load databases that are part of a module. Building once will give you the ability to add the class.
 */
public static void initModule(Class<? extends DatabaseHolder> generatedClassName){
  loadDatabaseHolder(generatedClassName);
}
Program: 26806
Project: 26806
Buggy source:
@Override public Transaction.Builder beginTransactionAsync(ITransaction transaction){
}

Fixed version (ground truth):
@Override public Transaction.Builder beginTransactionAsync(ITransaction transaction){
  return new Transaction.Builder(transaction,this);
}
Program: 26807
Project: 26807
Buggy source:
public Builder add(TModel model){
  models.add(model);
  return this;
}

Fixed version (ground truth):
public Builder<TModel> add(TModel model){
  models.add(model);
  return this;
}
Program: 26808
Project: 26808
Buggy source:
public Builder processListener(OnModelProcessListener<TModel> processListener){
  this.processListener=processListener;
  return this;
}

Fixed version (ground truth):
public Builder<TModel> processListener(OnModelProcessListener<TModel> processListener){
  this.processListener=processListener;
  return this;
}
Program: 26809
Project: 26809
Buggy source:
public Builder addAll(Collection<TModel> models){
  this.models.addAll(models);
  return this;
}

Fixed version (ground truth):
public Builder<TModel> addAll(Collection<TModel> models){
  this.models.addAll(models);
  return this;
}
Program: 26810
Project: 26810
Buggy source:
public Builder queryResult(QueryResultCallback<TResult> queryResultCallback){
  this.queryResultCallback=queryResultCallback;
  return this;
}

Fixed version (ground truth):
public Builder<TResult> queryResult(QueryResultCallback<TResult> queryResultCallback){
  this.queryResultCallback=queryResultCallback;
  return this;
}
Program: 26811
Project: 26811
Buggy source:
Transaction(Builder builder){
  errorCallback=builder.errorCallback;
  successCallback=builder.successCallback;
  transaction=builder.transaction;
}

Fixed version (ground truth):
Transaction(Builder builder){
  databaseWrapper=builder.databaseWrapper;
  errorCallback=builder.errorCallback;
  successCallback=builder.successCallback;
  transaction=builder.transaction;
}
Program: 26812
Project: 26812
Buggy source:
public void execute(){
}

Fixed version (ground truth):
public void execute(){
  try {
    transaction.execute(databaseWrapper);
  }
 catch (  Throwable throwable) {
    if (errorCallback != null) {
      errorCallback.onError(transaction,throwable);
    }
  }
}
Program: 26813
Project: 26813
Buggy source:
public MigrationDefinition(ProcessorManager processorManager,TypeElement typeElement){
  super(typeElement,processorManager);
  setOutputClassName("String_Node_Str");
  Migration migration=typeElement.getAnnotation(Migration.class);
  if (migration == null) {
    processorManager.logError("String_Node_Str" + typeElement);
  }
 else {
    try {
      migration.database();
    }
 catch (    MirroredTypeException mte) {
      databaseName=TypeName.get(mte.getTypeMirror());
    }
    version=migration.version();
    priority=migration.priority();
  }
}

Fixed version (ground truth):
public MigrationDefinition(ProcessorManager processorManager,TypeElement typeElement){
  super(typeElement,processorManager);
  setOutputClassName("String_Node_Str");
  Migration migration=typeElement.getAnnotation(Migration.class);
  if (migration == null) {
    processorManager.logError("String_Node_Str" + typeElement);
  }
 else {
    try {
      migration.database();
    }
 catch (    MirroredTypeException mte) {
      databaseName=TypeName.get(mte.getTypeMirror());
    }
    version=migration.version();
    priority=migration.priority();
    List<? extends Element> elements=typeElement.getEnclosedElements();
    for (    Element element : elements) {
      if (element instanceof ExecutableElement && element.getSimpleName().toString().equals("String_Node_Str")) {
        if (!StringUtils.isNullOrEmpty(constructorName)) {
          manager.logError(MigrationDefinition.class,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
        }
        if (((ExecutableElement)element).getParameters().isEmpty()) {
          constructorName="String_Node_Str";
        }
 else         if (((ExecutableElement)element).getParameters().size() == 1) {
          List<? extends Element> params=((ExecutableElement)element).getParameters();
          Element param=params.get(0);
          TypeName type=TypeName.get(param.asType());
          if (type instanceof ParameterizedTypeName && ((ParameterizedTypeName)type).rawType.equals(ClassName.get(Class.class))) {
            TypeName containedType=((ParameterizedTypeName)type).typeArguments.get(0);
            constructorName=CodeBlock.builder().add("String_Node_Str",containedType).build().toString();
          }
 else {
            manager.logError(MigrationDefinition.class,"String_Node_Str" + "String_Node_Str",typeElement,type);
          }
        }
      }
    }
  }
}
Program: 26815
Project: 26815
Buggy source:
/** 
 * @param isModelContainerAdapter
 * @param codeBuilder
 * @return A string without any type conversion for this field.
 */
public void appendPropertyComparisonAccessStatement(boolean isModelContainerAdapter,CodeBlock.Builder codeBuilder){
  codeBuilder.add("String_Node_Str",tableDefinition.getPropertyClassName(),columnName);
  if (columnAccess instanceof TypeConverterAccess) {
    TypeConverterAccess converterAccess=((TypeConverterAccess)columnAccess);
    TypeConverterDefinition converterDefinition=converterAccess.typeConverterDefinition;
    if (!isModelContainerAdapter) {
      codeBuilder.add(converterAccess.existingColumnAccess.getColumnAccessString(converterDefinition.getDbTypeName(),containerKeyName,elementName,ModelUtils.getVariable(isModelContainerAdapter),isModelContainerAdapter,false));
    }
 else {
      codeBuilder.add(CodeBlock.builder().add("String_Node_Str",ModelUtils.getVariable(isModelContainerAdapter),converterAccess.typeConverterDefinition.getModelTypeName(),containerKeyName).build());
    }
  }
 else {
    codeBuilder.add(getColumnAccessString(isModelContainerAdapter,false));
  }
  codeBuilder.add("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param isModelContainerAdapter
 * @param codeBuilder
 * @return A string without any type conversion for this field.
 */
public void appendPropertyComparisonAccessStatement(boolean isModelContainerAdapter,CodeBlock.Builder codeBuilder){
  codeBuilder.add("String_Node_Str",tableDefinition.getPropertyClassName(),columnName);
  if (columnAccess instanceof TypeConverterAccess) {
    TypeConverterAccess converterAccess=((TypeConverterAccess)columnAccess);
    TypeConverterDefinition converterDefinition=converterAccess.typeConverterDefinition;
    if (!isModelContainerAdapter) {
      codeBuilder.add(converterAccess.existingColumnAccess.getColumnAccessString(converterDefinition.getDbTypeName(),containerKeyName,elementName,ModelUtils.getVariable(isModelContainerAdapter),isModelContainerAdapter,false));
    }
 else {
      codeBuilder.add(CodeBlock.builder().add("String_Node_Str",ModelUtils.getVariable(isModelContainerAdapter),converterAccess.typeConverterDefinition.getModelTypeName(),containerKeyName).build());
    }
  }
 else {
    String columnAccessString=getColumnAccessString(isModelContainerAdapter,false);
    if (columnAccess instanceof BlobColumnAccess) {
      columnAccessString=columnAccessString.substring(0,columnAccessString.lastIndexOf("String_Node_Str"));
    }
    codeBuilder.add(columnAccessString);
  }
  codeBuilder.add("String_Node_Str");
}
Program: 26817
Project: 26817
Buggy source:
/** 
 * If   {@link ForeignKey} has no {@link ForeignKeyReference}s, we use the primary key the referenced table. We do this post-evaluation so all of the   {@link TableDefinition} can be generated.
 */
private void checkNeedsReferences(){
  TableDefinition referencedTableDefinition=manager.getTableDefinition(tableDefinition.databaseTypeName,referencedTableClassName);
  if (referencedTableDefinition == null) {
    manager.logError("String_Node_Str" + "String_Node_Str",referencedTableClassName,tableDefinition.tableName,tableDefinition.databaseTypeName);
  }
 else {
    if (needsReferences) {
      List<ColumnDefinition> primaryColumns=referencedTableDefinition.getPrimaryColumnDefinitions();
      for (      ColumnDefinition primaryColumn : primaryColumns) {
        ForeignKeyReferenceDefinition foreignKeyReferenceDefinition=new ForeignKeyReferenceDefinition(manager,elementName,primaryColumn,columnAccess,this);
        foreignKeyReferenceDefinitionList.add(foreignKeyReferenceDefinition);
      }
      if (nonModelColumn) {
        columnName=foreignKeyReferenceDefinitionList.get(0).columnName;
      }
      needsReferences=false;
    }
  }
}

Fixed version (ground truth):
/** 
 * If   {@link ForeignKey} has no {@link ForeignKeyReference}s, we use the primary key the referenced table. We do this post-evaluation so all of the   {@link TableDefinition} can be generated.
 */
private void checkNeedsReferences(){
  TableDefinition referencedTableDefinition=manager.getTableDefinition(tableDefinition.databaseTypeName,referencedTableClassName);
  if (referencedTableDefinition == null) {
    manager.logError("String_Node_Str" + "String_Node_Str",referencedTableClassName,tableDefinition.tableName,tableDefinition.databaseTypeName);
  }
 else {
    if (needsReferences) {
      List<ColumnDefinition> primaryColumns=referencedTableDefinition.getPrimaryColumnDefinitions();
      for (      ColumnDefinition primaryColumn : primaryColumns) {
        ForeignKeyReferenceDefinition foreignKeyReferenceDefinition=new ForeignKeyReferenceDefinition(manager,elementName,primaryColumn,columnAccess,this,primaryColumns.size());
        foreignKeyReferenceDefinitionList.add(foreignKeyReferenceDefinition);
      }
      if (nonModelColumn) {
        columnName=foreignKeyReferenceDefinitionList.get(0).columnName;
      }
      needsReferences=false;
    }
  }
}
Program: 26818
Project: 26818
Buggy source:
@Override public MethodSpec getMethodSpec(){
  MethodSpec.Builder methodBuilder=MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC,Modifier.FINAL).addParameter(tableDefinition.getParameterClassName(isModelContainerAdapter),ModelUtils.getVariable(isModelContainerAdapter)).returns(ClassNames.CONDITION_GROUP);
  CodeBlock.Builder code=CodeBlock.builder().add("String_Node_Str",ClassNames.CONDITION_GROUP);
  for (  ColumnDefinition columnDefinition : tableDefinition.getPrimaryColumnDefinitions()) {
    code.add("String_Node_Str",tableDefinition.getPropertyClassName(),columnDefinition.columnName,columnDefinition.getPropertyComparisonAccessStatement(isModelContainerAdapter));
  }
  methodBuilder.addCode(code.addStatement("String_Node_Str").build());
  return methodBuilder.build();
}

Fixed version (ground truth):
@Override public MethodSpec getMethodSpec(){
  MethodSpec.Builder methodBuilder=MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC,Modifier.FINAL).addParameter(tableDefinition.getParameterClassName(isModelContainerAdapter),ModelUtils.getVariable(isModelContainerAdapter)).returns(ClassNames.CONDITION_GROUP);
  CodeBlock.Builder code=CodeBlock.builder();
  code.add("String_Node_Str",ClassNames.CONDITION_GROUP);
  for (  ColumnDefinition columnDefinition : tableDefinition.getPrimaryColumnDefinitions()) {
    CodeBlock.Builder codeBuilder=CodeBlock.builder();
    columnDefinition.appendPropertyComparisonAccessStatement(isModelContainerAdapter,codeBuilder);
    code.add(codeBuilder.build());
  }
  methodBuilder.addCode(code.addStatement("String_Node_Str").build());
  return methodBuilder.build();
}
Program: 26822
Project: 26822
Buggy source:
/** 
 * @return Starts an arbitrary clause of conditions to use, that when included in other {@link SQLCondition}, does not append paranthesis to group it.
 */
public static ConditionGroup nonGroupingClause(){
  return new ConditionGroup();
}

Fixed version (ground truth):
/** 
 * @return Starts an arbitrary clause of conditions to use, that when included in other {@link SQLCondition}, does not append parenthesis to group it.
 */
public static ConditionGroup nonGroupingClause(){
  return new ConditionGroup();
}
Program: 26824
Project: 26824
Buggy source:
public Method(String methodName,IProperty... properties){
  super(null,methodName);
  Collections.addAll(propertyList,properties);
  if (propertyList.isEmpty()) {
    propertyList.add(Property.ALL_PROPERTY);
  }
}

Fixed version (ground truth):
public Method(String methodName,IProperty... properties){
  super(null,(String)null);
  methodProperty=new Property(null,new NameAlias(methodName,false).tickName(false));
  if (properties.length == 0) {
    propertyList.add(Property.ALL_PROPERTY);
  }
 else {
    for (    IProperty property : properties) {
      addProperty(property);
    }
  }
}
Program: 26825
Project: 26825
Buggy source:
/** 
 * Allows adding a property to the   {@link Method}. Will remove the   {@link Property#ALL_PROPERTY}if it exists as first item.
 * @param property The property to add.
 */
protected void addProperty(@NonNull IProperty property){
  propertyList.add(property);
}

Fixed version (ground truth):
/** 
 * Allows adding a property to the   {@link Method}. Will remove the   {@link Property#ALL_PROPERTY}if it exists as first item.
 * @param property The property to add.
 */
public Method addProperty(@NonNull IProperty property){
  if (propertyList.size() == 1 && propertyList.get(0) == Property.ALL_PROPERTY) {
    propertyList.remove(0);
  }
  return append(property,"String_Node_Str");
}
Program: 26826
Project: 26826
Buggy source:
/** 
 * @return The original name of this alias.
 */
@NonNull public String getName(){
  String fullName="String_Node_Str";
  if (prefixName != null) {
    fullName+=(tickName ? QueryBuilder.quoteIfNeeded(prefixName) : prefixName) + "String_Node_Str";
  }
  fullName+=(tickName ? QueryBuilder.quote(name) : getNamePropertyRaw());
  return fullName;
}

Fixed version (ground truth):
/** 
 * @return The original name of this alias.
 */
@NonNull public String getName(){
  String fullName="String_Node_Str";
  if (prefixName != null) {
    fullName+=(tickName ? QueryBuilder.quoteIfNeeded(prefixName) : prefixName) + "String_Node_Str";
  }
  if (name != null) {
    fullName+=(tickName ? QueryBuilder.quote(name) : getNamePropertyRaw());
  }
  return fullName;
}
Program: 26827
Project: 26827
Buggy source:
@Override public void onCreate(SQLiteDatabase db){
  databaseHelperDelegate.onCreate(SQLCipherDatabase.from(db));
}

Fixed version (ground truth):
@Override public void onCreate(SQLiteDatabase db){
  baseDatabaseHelper.onCreate(SQLCipherDatabase.from(db));
}
Program: 26828
Project: 26828
Buggy source:
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  databaseHelperDelegate.onUpgrade(SQLCipherDatabase.from(db),oldVersion,newVersion);
}

Fixed version (ground truth):
@Override public void onUpgrade(SQLiteDatabase db,int oldVersion,int newVersion){
  baseDatabaseHelper.onUpgrade(SQLCipherDatabase.from(db),oldVersion,newVersion);
}
Program: 26829
Project: 26829
Buggy source:
@Override public void onOpen(SQLiteDatabase db){
  databaseHelperDelegate.onOpen(SQLCipherDatabase.from(db));
}

Fixed version (ground truth):
@Override public void onOpen(SQLiteDatabase db){
  baseDatabaseHelper.onOpen(SQLCipherDatabase.from(db));
}
Program: 26830
Project: 26830
Buggy source:
public BackupHelper(Context context,String name,int version){
  super(context,name,null,version);
}

Fixed version (ground truth):
public BackupHelper(Context context,String name,int version,BaseDatabaseDefinition databaseDefinition){
  super(context,name,null,version);
  this.baseDatabaseHelper=new BaseDatabaseHelper(databaseDefinition);
}
Program: 26831
Project: 26831
Buggy source:
public SQLCipherOpenHelper(BaseDatabaseDefinition databaseDefinition,DatabaseHelperListener listener){
  super(FlowManager.getContext(),databaseDefinition.isInMemory() ? null : databaseDefinition.getDatabaseFileName(),null,databaseDefinition.getDatabaseVersion());
  OpenHelper backupHelper=null;
  if (databaseDefinition.backupEnabled()) {
    backupHelper=new BackupHelper(FlowManager.getContext(),DatabaseHelperDelegate.getTempDbFileName(databaseDefinition),databaseDefinition.getDatabaseVersion()){
      @Override public void onOpen(      SQLiteDatabase db){
        SQLCipherOpenHelper.this.onOpen(db);
      }
      @Override public void onCreate(      SQLiteDatabase db){
        SQLCipherOpenHelper.this.onCreate(db);
      }
      @Override public void onUpgrade(      SQLiteDatabase db,      int oldVersion,      int newVersion){
        SQLCipherOpenHelper.this.onUpgrade(db,oldVersion,newVersion);
      }
    }
;
  }
  databaseHelperDelegate=new DatabaseHelperDelegate(listener,databaseDefinition,backupHelper);
}

Fixed version (ground truth):
public SQLCipherOpenHelper(BaseDatabaseDefinition databaseDefinition,DatabaseHelperListener listener){
  super(FlowManager.getContext(),databaseDefinition.isInMemory() ? null : databaseDefinition.getDatabaseFileName(),null,databaseDefinition.getDatabaseVersion());
  OpenHelper backupHelper=null;
  if (databaseDefinition.backupEnabled()) {
    backupHelper=new BackupHelper(FlowManager.getContext(),DatabaseHelperDelegate.getTempDbFileName(databaseDefinition),databaseDefinition.getDatabaseVersion(),databaseDefinition);
  }
  databaseHelperDelegate=new DatabaseHelperDelegate(listener,databaseDefinition,backupHelper);
}
Program: 26835
Project: 26835
Buggy source:
/** 
 * @return The full definition name that this Alias uses to define its definition.E.g: `firstName` AS `FN`.
 */
@NonNull public String getDefinition(){
  StringBuilder definition=new StringBuilder();
  if (prefixName != null) {
    definition.append(tickName ? QueryBuilder.quoteIfNeeded(prefixName) : prefixName).append("String_Node_Str");
  }
  definition.append(tickName ? getName() : getNamePropertyRaw());
  if (hasAlias()) {
    definition.append("String_Node_Str").append(getAliasName());
  }
  return definition.toString();
}

Fixed version (ground truth):
/** 
 * @return The full definition name that this Alias uses to define its definition.E.g: `firstName` AS `FN`.
 */
@NonNull public String getDefinition(){
  StringBuilder definition=new StringBuilder();
  definition.append(getName());
  if (hasAlias()) {
    definition.append("String_Node_Str").append(getAliasName());
  }
  return definition.toString();
}
Program: 26836
Project: 26836
Buggy source:
public FlowManagerHolderDefinition(ProcessorManager processorManager){
  this.processorManager=processorManager;
  Map<String,String> options=this.processorManager.getProcessingEnvironment().getOptions();
  if (options.containsKey(OPTION_TARGET_MODULE_NAME))   className=options.get(OPTION_TARGET_MODULE_NAME);
  className+=ClassNames.DATABASE_HOLDER_STATIC_CLASS_NAME;
}

Fixed version (ground truth):
public FlowManagerHolderDefinition(ProcessorManager processorManager){
  this.processorManager=processorManager;
  Map<String,String> options=this.processorManager.getProcessingEnvironment().getOptions();
  if (options.containsKey(OPTION_TARGET_MODULE_NAME)) {
    className=options.get(OPTION_TARGET_MODULE_NAME);
  }
  className+=ClassNames.DATABASE_HOLDER_STATIC_CLASS_NAME;
}
Program: 26837
Project: 26837
Buggy source:
/** 
 * @param databaseName The name of the database. Will throw an exception if the database doesn't exist.
 * @return the {@link BaseDatabaseDefinition} for the specified database
 */
public static BaseDatabaseDefinition getDatabase(String databaseName){
  BaseDatabaseDefinition database=globalDatabaseHolder.getDatabase(databaseName);
  if (database != null)   return database;
  throw new InvalidDBConfiguration("String_Node_Str" + databaseName + "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param databaseName The name of the database. Will throw an exception if the database doesn't exist.
 * @return the {@link BaseDatabaseDefinition} for the specified database
 */
public static BaseDatabaseDefinition getDatabase(String databaseName){
  BaseDatabaseDefinition database=globalDatabaseHolder.getDatabase(databaseName);
  if (database != null) {
    return database;
  }
  throw new InvalidDBConfiguration("String_Node_Str" + databaseName + "String_Node_Str"+ "String_Node_Str");
}
Program: 26838
Project: 26838
Buggy source:
/** 
 * Loading the module Database holder via reflection. This will trigger all creations, updates, and instantiation for each database defined. It is assumed FlowManager.init() is called by the application that uses the module database. This method should only be called if you need to load databases that are part of a module.
 */
public static void initModule(String moduleName){
  loadDatabaseHolder(DEFAULT_DATABASE_HOLDER_PACKAGE_NAME + "String_Node_Str" + moduleName+ DEFAULT_DATABASE_HOLDER_NAME);
}

Fixed version (ground truth):
/** 
 * Loading the module Database holder via reflection. This will trigger all creations, updates, and instantiation for each database defined. <p> It is assumed FlowManager.init() is called by the application that uses the module database. This method should only be called if you need to load databases that are part of a module.
 */
public static void initModule(String moduleName){
  loadDatabaseHolder(DEFAULT_DATABASE_HOLDER_PACKAGE_NAME + "String_Node_Str" + moduleName+ DEFAULT_DATABASE_HOLDER_NAME);
}
Program: 26839
Project: 26839
Buggy source:
/** 
 * @return The database holder, creating if necessary using reflection.
 */
protected static void loadDatabaseHolder(String className){
  if (loadedModules.contains(className))   return;
  try {
    DatabaseHolder dbHolder=(DatabaseHolder)Class.forName(className).newInstance();
    if (dbHolder != null) {
      globalDatabaseHolder.add(dbHolder);
      loadedModules.add(className);
    }
  }
 catch (  Throwable e) {
    throw new ModuleNotFoundException("String_Node_Str" + className,e);
  }
}

Fixed version (ground truth):
/** 
 * @return The database holder, creating if necessary using reflection.
 */
protected static void loadDatabaseHolder(String className){
  if (loadedModules.contains(className)) {
    return;
  }
  try {
    DatabaseHolder dbHolder=(DatabaseHolder)Class.forName(className).newInstance();
    if (dbHolder != null) {
      globalDatabaseHolder.add(dbHolder);
      loadedModules.add(className);
    }
  }
 catch (  Throwable e) {
    throw new ModuleNotFoundException("String_Node_Str" + className,e);
  }
}
Program: 26843
Project: 26843
Buggy source:
/** 
 * Converts the given value for the column if it has a type converter. Then it turns that result into a string.
 * @param value The value of the column in Model format.
 * @return Returns the result of converting and type converting the specified value.
 */
@SuppressWarnings("String_Node_Str") public static String convertValueToString(Object value){
  String stringVal;
  if (value != null) {
    TypeConverter typeConverter=FlowManager.getTypeConverterForClass(value.getClass());
    if (typeConverter != null) {
      value=typeConverter.getDBValue(value);
    }
  }
  if (value instanceof Number) {
    stringVal=String.valueOf(value);
  }
 else {
    if (value instanceof NameAlias) {
      stringVal=((NameAlias)value).getQuery();
    }
 else     if (value instanceof SQLCondition) {
      QueryBuilder queryBuilder=new QueryBuilder();
      ((SQLCondition)value).appendConditionToQuery(queryBuilder);
      stringVal=queryBuilder.toString();
    }
 else     if (value instanceof Query) {
      stringVal=((Query)value).getQuery();
    }
 else {
      stringVal=String.valueOf(value);
      if (!stringVal.equals(Condition.Operation.EMPTY_PARAM)) {
        stringVal=DatabaseUtils.sqlEscapeString(stringVal);
      }
    }
  }
  return stringVal;
}

Fixed version (ground truth):
/** 
 * Converts the given value for the column if it has a type converter. Then it turns that result into a string.
 * @param value                       The value of the column in Model format.
 * @param appendInnerQueryParenthesis if its an inner query value in a condition, we append paranthesis to the query.
 * @return Returns the result of converting and type converting the specified value.
 */
@SuppressWarnings("String_Node_Str") public static String convertValueToString(Object value,boolean appendInnerQueryParenthesis){
  String stringVal;
  if (value != null) {
    TypeConverter typeConverter=FlowManager.getTypeConverterForClass(value.getClass());
    if (typeConverter != null) {
      value=typeConverter.getDBValue(value);
    }
  }
  if (value instanceof Number) {
    stringVal=String.valueOf(value);
  }
 else {
    if (appendInnerQueryParenthesis && value instanceof BaseModelQueriable) {
      stringVal=String.format("String_Node_Str",((BaseModelQueriable)value).getQuery().trim());
    }
 else     if (value instanceof NameAlias) {
      stringVal=((NameAlias)value).getQuery();
    }
 else     if (value instanceof SQLCondition) {
      QueryBuilder queryBuilder=new QueryBuilder();
      ((SQLCondition)value).appendConditionToQuery(queryBuilder);
      stringVal=queryBuilder.toString();
    }
 else     if (value instanceof Query) {
      stringVal=((Query)value).getQuery();
    }
 else {
      stringVal=String.valueOf(value);
      if (!stringVal.equals(Condition.Operation.EMPTY_PARAM)) {
        stringVal=DatabaseUtils.sqlEscapeString(stringVal);
      }
    }
  }
  return stringVal;
}
Program: 26844
Project: 26844
Buggy source:
/** 
 * Returns a string containing the tokens joined by delimiters and converted into the property values for a query.
 * @param delimiter The text to join the text with.
 * @param tokens    an {@link Iterable} of objects to be joined. Strings will be formed fromthe objects by calling  {@link #convertValueToString(Object)}.
 * @return A joined string
 */
public static String joinArguments(CharSequence delimiter,Iterable tokens){
  StringBuilder sb=new StringBuilder();
  boolean firstTime=true;
  for (  Object token : tokens) {
    if (firstTime) {
      firstTime=false;
    }
 else {
      sb.append(delimiter);
    }
    sb.append(convertValueToString(token));
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string containing the tokens joined by delimiters and converted into the property values for a query.
 * @param delimiter The text to join the text with.
 * @param tokens    an {@link Iterable} of objects to be joined. Strings will be formed fromthe objects by calling  {@link #convertValueToString(Object,boolean)}.
 * @return A joined string
 */
public static String joinArguments(CharSequence delimiter,Iterable tokens){
  StringBuilder sb=new StringBuilder();
  boolean firstTime=true;
  for (  Object token : tokens) {
    if (firstTime) {
      firstTime=false;
    }
 else {
      sb.append(delimiter);
    }
    sb.append(convertValueToString(token,false));
  }
  return sb.toString();
}