nus-yam/ex-repair huggingface dataset:
Program: 26985
Project: 26985
Buggy source:
public ForeignKeyReferenceDefinition(ProcessorManager manager,String foreignKeyFieldName,ForeignKeyReference foreignKeyReference,BaseColumnAccess tableColumnAccess){
  this.manager=manager;
  this.foreignKeyFieldName=foreignKeyFieldName;
  this.tableColumnAccess=tableColumnAccess;
  columnName=foreignKeyReference.columnName();
  foreignColumnName=foreignKeyReference.foreignKeyColumnName();
  TypeMirror columnClass=null;
  try {
    foreignKeyReference.columnType();
  }
 catch (  MirroredTypeException mte) {
    columnClass=mte.getTypeMirror();
  }
  columnClassName=TypeName.get(columnClass);
  isReferencedFieldPrivate=foreignKeyReference.referencedFieldIsPrivate();
  if (isReferencedFieldPrivate) {
    columnAccess=new PrivateColumnAccess(foreignKeyReference);
  }
 else {
    columnAccess=new SimpleColumnAccess();
  }
}

Fixed version (ground truth):
public ForeignKeyReferenceDefinition(ProcessorManager manager,String foreignKeyFieldName,ForeignKeyReference foreignKeyReference,BaseColumnAccess tableColumnAccess,ForeignKeyColumnDefinition foreignKeyColumnDefinition){
  this.manager=manager;
  this.foreignKeyFieldName=foreignKeyFieldName;
  this.tableColumnAccess=tableColumnAccess;
  this.foreignKeyColumnDefinition=foreignKeyColumnDefinition;
  columnName=foreignKeyReference.columnName();
  foreignColumnName=foreignKeyReference.foreignKeyColumnName();
  TypeMirror columnClass=null;
  try {
    foreignKeyReference.columnType();
  }
 catch (  MirroredTypeException mte) {
    columnClass=mte.getTypeMirror();
  }
  columnClassName=TypeName.get(columnClass);
  isReferencedFieldPrivate=foreignKeyReference.referencedFieldIsPrivate();
  if (isReferencedFieldPrivate) {
    columnAccess=new PrivateColumnAccess(foreignKeyReference);
  }
 else {
    columnAccess=new SimpleColumnAccess();
  }
}
Program: 26986
Project: 26986
Buggy source:
public static void writeGetTableName(TypeSpec.Builder typeBuilder,final String tableName){
  typeBuilder.addMethod(MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PUBLIC,Modifier.FINAL).addStatement("String_Node_Str",tableName).returns(ClassName.get(String.class)).build());
}

Fixed version (ground truth):
public static void writeGetTableName(TypeSpec.Builder typeBuilder,final String tableName){
  typeBuilder.addMethod(MethodSpec.methodBuilder("String_Node_Str").addModifiers(Modifier.PUBLIC,Modifier.FINAL).addStatement("String_Node_Str",QueryBuilder.quote(tableName)).returns(ClassName.get(String.class)).build());
}
Program: 26987
Project: 26987
Buggy source:
@Override public void onWriteDefinition(TypeSpec.Builder typeBuilder){
  typeBuilder.addField(FieldSpec.builder(ParameterizedTypeName.get(ClassName.get(Map.class),ClassName.get(String.class),ClassName.get(Class.class)),"String_Node_Str",Modifier.PRIVATE,Modifier.FINAL).initializer("String_Node_Str",ParameterizedTypeName.get(HashMap.class)).build());
  CodeBlock.Builder constructorCode=CodeBlock.builder();
  for (  ColumnDefinition columnDefinition : tableDefinition.columnDefinitions) {
    constructorCode.addStatement("String_Node_Str","String_Node_Str",columnDefinition.columnName,columnDefinition.elementTypeName);
  }
  typeBuilder.addMethod(MethodSpec.constructorBuilder().addCode(constructorCode.build()).addModifiers(Modifier.PUBLIC).build());
  typeBuilder.addMethod(MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC,Modifier.FINAL).addParameter(ClassName.get(String.class),"String_Node_Str").addStatement("String_Node_Str","String_Node_Str","String_Node_Str").returns(ParameterizedTypeName.get(ClassName.get(Class.class))).build());
  InternalAdapterHelper.writeGetModelClass(typeBuilder,elementClassName);
  InternalAdapterHelper.writeGetTableName(typeBuilder,elementClassName + tableDefinition.databaseMethod.classSeparator + TableDefinition.DBFLOW_TABLE_TAG);
  for (  MethodDefinition method : methods) {
    MethodSpec methodSpec=method.getMethodSpec();
    if (methodSpec != null) {
      typeBuilder.addMethod(methodSpec);
    }
  }
}

Fixed version (ground truth):
@Override public void onWriteDefinition(TypeSpec.Builder typeBuilder){
  typeBuilder.addField(FieldSpec.builder(ParameterizedTypeName.get(ClassName.get(Map.class),ClassName.get(String.class),ClassName.get(Class.class)),"String_Node_Str",Modifier.PRIVATE,Modifier.FINAL).initializer("String_Node_Str",ParameterizedTypeName.get(HashMap.class)).build());
  CodeBlock.Builder constructorCode=CodeBlock.builder();
  for (  ColumnDefinition columnDefinition : tableDefinition.columnDefinitions) {
    constructorCode.addStatement("String_Node_Str","String_Node_Str",columnDefinition.columnName,columnDefinition.elementTypeName);
  }
  typeBuilder.addMethod(MethodSpec.constructorBuilder().addCode(constructorCode.build()).addModifiers(Modifier.PUBLIC).build());
  typeBuilder.addMethod(MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC,Modifier.FINAL).addParameter(ClassName.get(String.class),"String_Node_Str").addStatement("String_Node_Str","String_Node_Str","String_Node_Str").returns(ClassName.get(Class.class)).build());
  InternalAdapterHelper.writeGetModelClass(typeBuilder,elementClassName);
  InternalAdapterHelper.writeGetTableName(typeBuilder,elementClassName + tableDefinition.databaseMethod.classSeparator + TableDefinition.DBFLOW_TABLE_TAG);
  for (  MethodDefinition method : methods) {
    MethodSpec methodSpec=method.getMethodSpec();
    if (methodSpec != null) {
      typeBuilder.addMethod(methodSpec);
    }
  }
}
Program: 26988
Project: 26988
Buggy source:
@Override public MethodSpec getMethodSpec(){
  CodeBlock.Builder codeBuilder=CodeBlock.builder().addStatement("String_Node_Str",tableDefinition.elementClassName,ModelUtils.getVariable(false),tableDefinition.elementClassName);
  for (  ColumnDefinition columnDefinition : tableDefinition.getColumnDefinitions()) {
    codeBuilder.add(columnDefinition.getToModelMethod(isModelContainerDefinition));
  }
  codeBuilder.addStatement("String_Node_Str",ModelUtils.getVariable(false));
  return MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC,Modifier.FINAL).addParameter(ParameterizedTypeName.get(ClassNames.MODEL_CONTAINER,tableDefinition.elementTypeName),ModelUtils.getVariable(true)).addCode(codeBuilder.build()).build();
}

Fixed version (ground truth):
@Override public MethodSpec getMethodSpec(){
  CodeBlock.Builder codeBuilder=CodeBlock.builder().addStatement("String_Node_Str",tableDefinition.elementClassName,ModelUtils.getVariable(false),tableDefinition.elementClassName);
  for (  ColumnDefinition columnDefinition : tableDefinition.getColumnDefinitions()) {
    codeBuilder.add(columnDefinition.getToModelMethod(isModelContainerDefinition));
  }
  codeBuilder.addStatement("String_Node_Str",ModelUtils.getVariable(false));
  return MethodSpec.methodBuilder("String_Node_Str").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC,Modifier.FINAL).addParameter(ParameterizedTypeName.get(ClassNames.MODEL_CONTAINER,tableDefinition.elementTypeName,WildcardTypeName.get(tableDefinition.manager.getTypeUtils().getWildcardType(null,null))),ModelUtils.getVariable(true)).addCode(codeBuilder.build()).build();
}
Program: 26989
Project: 26989
Buggy source:
public Set<ModelContainerDefinition> getModelContainers(String databaseName){
  Map<String,ModelContainerDefinition> modelContainerDefinitionMap=modelContainers.get(databaseName);
  if (modelContainerDefinitionMap != null) {
    return Sets.newHashSet(modelContainers.get(databaseName).values());
  }
  return Sets.newHashSet();
}

Fixed version (ground truth):
public Set<ModelContainerDefinition> getModelContainers(String databaseName){
  Map<TypeName,ModelContainerDefinition> modelContainerDefinitionMap=modelContainers.get(databaseName);
  if (modelContainerDefinitionMap != null) {
    return Sets.newHashSet(modelContainers.get(databaseName).values());
  }
  return Sets.newHashSet();
}
Program: 26990
Project: 26990
Buggy source:
public void addModelContainerDefinition(ModelContainerDefinition modelContainerDefinition){
  Map<String,ModelContainerDefinition> modelContainerDefinitionMap=modelContainers.get(getDatabase(modelContainerDefinition.elementClassName));
  if (modelContainerDefinitionMap == null) {
    modelContainerDefinitionMap=Maps.newHashMap();
    modelContainers.put(getDatabase(modelContainerDefinition.elementClassName),modelContainerDefinitionMap);
  }
  modelContainerDefinitionMap.put(modelContainerDefinition.getModelClassQualifiedName(),modelContainerDefinition);
}

Fixed version (ground truth):
public void addModelContainerDefinition(ModelContainerDefinition modelContainerDefinition){
  Map<TypeName,ModelContainerDefinition> modelContainerDefinitionMap=modelContainers.get(getDatabase(modelContainerDefinition.elementClassName));
  if (modelContainerDefinitionMap == null) {
    modelContainerDefinitionMap=Maps.newHashMap();
    modelContainers.put(getDatabase(modelContainerDefinition.elementClassName),modelContainerDefinitionMap);
  }
  modelContainerDefinitionMap.put(modelContainerDefinition.elementClassName,modelContainerDefinition);
}
Program: 26991
Project: 26991
Buggy source:
public ModelContainerDefinition getModelContainerDefinition(String databaseName,TypeElement typeElement){
  return modelContainers.get(databaseName).get(typeElement.getQualifiedName().toString());
}

Fixed version (ground truth):
public ModelContainerDefinition getModelContainerDefinition(String databaseName,TypeName typeName){
  return modelContainers.get(databaseName).get(typeName);
}
Program: 26992
Project: 26992
Buggy source:
public String getQuery(boolean useCastIfApplicable){
  AdapterQueryBuilder contentValue=new AdapterQueryBuilder();
  if (!requiresTypeConverter) {
    if (castedClass != null && useCastIfApplicable) {
      contentValue.appendCast(isABlob ? "String_Node_Str" : castedClass);
    }
 else {
      contentValue.append("String_Node_Str");
    }
  }
  contentValue.appendVariable(isModelContainerAdapter).append("String_Node_Str");
  if (isModelContainerAdapter) {
    contentValue.appendGetValue(containerKeyName);
  }
 else   if (fieldIsAModelContainer) {
    contentValue.append(columnName).append("String_Node_Str").appendGetValue(referencedColumnFieldName);
  }
 else {
    if (isForeignKeyField) {
      ColumnAccessModel columnAccessModel=new ColumnAccessModel(parentColumnDefinition.getManager(),parentColumnDefinition,isModelContainerAdapter);
      contentValue.append(columnAccessModel.getReferencedColumnFieldName()).append("String_Node_Str");
    }
    contentValue.append(getReferencedColumnFieldName());
  }
  if (isABlob && !isModelContainerAdapter) {
    contentValue.append("String_Node_Str");
  }
  if (!requiresTypeConverter) {
    contentValue.append("String_Node_Str");
  }
  return contentValue.getQuery();
}

Fixed version (ground truth):
public String getQuery(boolean useCastIfApplicable){
  AdapterQueryBuilder contentValue=new AdapterQueryBuilder();
  if (!requiresTypeConverter) {
    if (castedClass != null && useCastIfApplicable && !isABlob) {
      contentValue.appendCast(isABlob ? "String_Node_Str" : castedClass);
    }
 else {
      contentValue.append("String_Node_Str");
    }
  }
  contentValue.appendVariable(isModelContainerAdapter).append("String_Node_Str");
  if (isModelContainerAdapter) {
    contentValue.appendGetValue(containerKeyName);
  }
 else   if (fieldIsAModelContainer) {
    contentValue.append(columnName).append("String_Node_Str").appendGetValue(referencedColumnFieldName);
  }
 else {
    if (isForeignKeyField) {
      ColumnAccessModel columnAccessModel=new ColumnAccessModel(parentColumnDefinition.getManager(),parentColumnDefinition,isModelContainerAdapter);
      contentValue.append(columnAccessModel.getReferencedColumnFieldName()).append("String_Node_Str");
    }
    contentValue.append(getReferencedColumnFieldName());
  }
  if (isABlob && !isModelContainerAdapter) {
    contentValue.append("String_Node_Str");
  }
  if (!requiresTypeConverter) {
    contentValue.append("String_Node_Str");
  }
  return contentValue.getQuery();
}
Program: 26993
Project: 26993
Buggy source:
/** 
 * Constructs this transaction with a delete with the specified where args
 * @param dbTransactionInfo     The information about this transaction
 * @param conditionQueryBuilder The where statement that we will use
 */
public DeleteTransaction(DBTransactionInfo dbTransactionInfo,ConditionQueryBuilder<ModelClass> conditionQueryBuilder){
  super(dbTransactionInfo,new Delete().from(conditionQueryBuilder.getTableClass()).where(conditionQueryBuilder));
}

Fixed version (ground truth):
/** 
 * Constructs this transaction with a delete with an empty "where" clause
 * @param dbTransactionInfo The information about this transaction
 * @param table             The model table that we act on
 */
public DeleteTransaction(DBTransactionInfo dbTransactionInfo,Class<ModelClass> table,SQLCondition... conditions){
  super(dbTransactionInfo,new Delete().from(table).where(conditions));
}
Program: 26994
Project: 26994
Buggy source:
/** 
 * Creates an instance of this class. Selects all from the specified table.
 * @param transactionListener The transaction listener.
 * @param table               The table to select from
 * @param columns             The columns to project the selection on.
 */
public SelectListTransaction(TransactionListener<List<ModelClass>> transactionListener,Class<ModelClass> table,String... columns){
  this(new Select(columns).from(table),transactionListener);
}

Fixed version (ground truth):
/** 
 * Creates an instance of this class. Selects all from the specified table.
 * @param transactionListener The transaction listener.
 * @param table               The table to select from
 * @param columns             The columns to project the selection on.
 */
public SelectListTransaction(TransactionListener<List<ModelClass>> transactionListener,Class<ModelClass> table,Property... columns){
  this(new Select(columns).from(table),transactionListener);
}
Program: 26995
Project: 26995
Buggy source:
/** 
 * Creates an instance of this class
 * @param transactionListener        The result that returns from this query.
 * @param whereConditionQueryBuilder The query builder used to SELECT.
 * @param columns                    The columns to project the SELECT on.
 */
public SelectSingleModelTransaction(TransactionListener<ModelClass> transactionListener,ConditionQueryBuilder<ModelClass> whereConditionQueryBuilder,String... columns){
  this(new Select(columns).from(whereConditionQueryBuilder.getTableClass()).where(whereConditionQueryBuilder),transactionListener);
}

Fixed version (ground truth):
/** 
 * Creates an instance of this class
 * @param transactionListener        The result that returns from this query.
 * @param whereConditionQueryBuilder The query builder used to SELECT.
 * @param properties                 The columns to project the SELECT on.
 */
public SelectSingleModelTransaction(TransactionListener<ModelClass> transactionListener,Class<ModelClass> table,ConditionGroup conditionGroup,Property... properties){
  this(new Select(properties).from(table).where(conditionGroup),transactionListener);
}
Program: 26996
Project: 26996
Buggy source:
/** 
 * Updates the model if it exists. If the model does not exist and no rows are changed, we will attempt an insert into the DB.
 * @param model        The model to update
 * @param modelAdapter The adapter to use
 * @return true if model was inserted, false if not. Also false could mean that it is placed on the{@link DBTransactionQueue} using async to true.
 */
@SuppressWarnings("String_Node_Str") public static <ModelClass extends Model,TableClass extends Model,AdapterClass extends RetrievalAdapter & InternalAdapter>boolean update(TableClass model,AdapterClass adapter,ModelAdapter<ModelClass> modelAdapter){
  boolean exists;
  SQLiteDatabase db=FlowManager.getDatabaseForTable(modelAdapter.getModelClass()).getWritableDatabase();
  ContentValues contentValues=new ContentValues();
  adapter.bindToContentValues(contentValues,model);
  exists=(SQLiteCompatibilityUtils.updateWithOnConflict(db,modelAdapter.getTableName(),contentValues,adapter.getPrimaryModelWhere(model).getQuery(),null,ConflictAction.getSQLiteDatabaseAlgorithmInt(modelAdapter.getUpdateOnConflictAction())) != 0);
  if (!exists) {
    insert(model,adapter,modelAdapter);
  }
 else {
    notifyModelChanged(model,adapter,modelAdapter,Action.UPDATE);
  }
  return exists;
}

Fixed version (ground truth):
/** 
 * Updates the model if it exists. If the model does not exist and no rows are changed, we will attempt an insert into the DB.
 * @param model        The model to update
 * @param modelAdapter The adapter to use
 * @return true if model was inserted, false if not. Also false could mean that it is placed on the{@link DBTransactionQueue} using async to true.
 */
@SuppressWarnings("String_Node_Str") public static <ModelClass extends Model,TableClass extends Model,AdapterClass extends RetrievalAdapter & InternalAdapter>boolean update(TableClass model,AdapterClass adapter,ModelAdapter<ModelClass> modelAdapter){
  boolean exists;
  SQLiteDatabase db=FlowManager.getDatabaseForTable(modelAdapter.getModelClass()).getWritableDatabase();
  ContentValues contentValues=new ContentValues();
  adapter.bindToContentValues(contentValues,model);
  exists=(SQLiteCompatibilityUtils.updateWithOnConflict(db,modelAdapter.getTableName(),contentValues,adapter.getPrimaryConditions(model).getQuery(),null,ConflictAction.getSQLiteDatabaseAlgorithmInt(modelAdapter.getUpdateOnConflictAction())) != 0);
  if (!exists) {
    insert(model,adapter,modelAdapter);
  }
 else {
    notifyModelChanged(model,adapter,modelAdapter,Action.UPDATE);
  }
  return exists;
}
Program: 26997
Project: 26997
Buggy source:
/** 
 * Deletes   {@link Model} from the database using the specfied {@link FlowManager}
 * @param model The model to delete
 */
@SuppressWarnings("String_Node_Str") public static <ModelClass extends Model,TableClass extends Model,AdapterClass extends RetrievalAdapter & InternalAdapter>void delete(final TableClass model,AdapterClass adapter,ModelAdapter<ModelClass> modelAdapter){
  new Delete().from((Class<TableClass>)adapter.getModelClass()).where(adapter.getPrimaryModelWhere(model)).query();
  adapter.updateAutoIncrement(model,0);
  notifyModelChanged(model,adapter,modelAdapter,Action.DELETE);
}

Fixed version (ground truth):
/** 
 * Deletes   {@link Model} from the database using the specfied {@link FlowManager}
 * @param model The model to delete
 */
@SuppressWarnings("String_Node_Str") public static <ModelClass extends Model,TableClass extends Model,AdapterClass extends RetrievalAdapter & InternalAdapter>void delete(final TableClass model,AdapterClass adapter,ModelAdapter<ModelClass> modelAdapter){
  new Delete().from((Class<TableClass>)adapter.getModelClass()).where(adapter.getPrimaryConditions(model)).query();
  adapter.updateAutoIncrement(model,0);
  notifyModelChanged(model,adapter,modelAdapter,Action.DELETE);
}
Program: 26998
Project: 26998
Buggy source:
/** 
 * Replaces empty parameter values such as "columnName = ?" with the array of values passed in. It must match the count of columns that are in this where query.
 * @param values The values of the fields we wish to replace. Must match the length of the empty params and must be in empty param mode.
 * @return A new {@link ConditionQueryBuilder} with the parameters filled in.
 */
public ConditionQueryBuilder<ModelClass> replaceEmptyParams(Object... values){
  if (!useEmptyParams) {
    throw new IllegalStateException("String_Node_Str" + ConditionQueryBuilder.class.getSimpleName() + "String_Node_Str"+ "String_Node_Str");
  }
  if (conditions.size() != values.length) {
    throw new IllegalArgumentException("String_Node_Str" + modelAdapter.getTableName());
  }
  ConditionQueryBuilder<ModelClass> conditionQueryBuilder=new ConditionQueryBuilder<>(modelAdapter.getModelClass());
  for (int i=0; i < values.length; i++) {
    SQLCondition condition=conditions.get(i);
    conditionQueryBuilder.addCondition(column(NameAlias.columnRaw(condition.columnName())).operation(condition.operation()).value(values[i]));
  }
  return conditionQueryBuilder;
}

Fixed version (ground truth):
/** 
 * Replaces empty parameter values such as "columnName = ?" with the array of values passed in. It must match the count of columns that are in this where query.
 * @param values The values of the fields we wish to replace. Must match the length of the empty params and must be in empty param mode.
 * @return A new {@link ConditionQueryBuilder} with the parameters filled in.
 */
public ConditionQueryBuilder<ModelClass> replaceEmptyParams(Object... values){
  if (!useEmptyParams) {
    throw new IllegalStateException("String_Node_Str" + ConditionQueryBuilder.class.getSimpleName() + "String_Node_Str"+ "String_Node_Str");
  }
  if (conditions.size() != values.length) {
    throw new IllegalArgumentException("String_Node_Str" + modelAdapter.getTableName());
  }
  ConditionQueryBuilder<ModelClass> conditionQueryBuilder=new ConditionQueryBuilder<>(modelAdapter.getModelClass());
  for (int i=0; i < values.length; i++) {
    SQLCondition condition=conditions.get(i);
    conditionQueryBuilder.addCondition(column(new NameAlias(condition.columnName()).tickName(false)).operation(condition.operation()).value(values[i]));
  }
  return conditionQueryBuilder;
}
Program: 26999
Project: 26999
Buggy source:
/** 
 * Appends the   {@link SQLCondition} with an {@link Condition.Operation#OR}
 * @param sqlCondition The condition to append.
 * @return This instance.
 */
public ConditionGroup or(SQLCondition sqlCondition){
  return operator(Condition.Operation.OR,sqlCondition);
}

Fixed version (ground truth):
/** 
 * Appends the   {@link SQLCondition} with an {@link Operation#OR}
 * @param sqlCondition The condition to append.
 * @return This instance.
 */
public ConditionGroup or(SQLCondition sqlCondition){
  return operator(Operation.OR,sqlCondition);
}
Program: 27000
Project: 27000
Buggy source:
/** 
 * Appends the   {@link SQLCondition} with an {@link Condition.Operation#AND}
 * @param sqlCondition The condition to append.
 * @return This instance.
 */
public ConditionGroup and(SQLCondition sqlCondition){
  return operator(Condition.Operation.AND,sqlCondition);
}

Fixed version (ground truth):
/** 
 * Appends the   {@link SQLCondition} with an {@link Operation#AND}
 * @param sqlCondition The condition to append.
 * @return This instance.
 */
public ConditionGroup and(SQLCondition sqlCondition){
  return operator(Operation.AND,sqlCondition);
}
Program: 27001
Project: 27001
Buggy source:
/** 
 * @return The first result of this query. It forces a {@link Where#limit(Object)} of 1 for more efficient querying.
 */
@Override public ModelClass querySingle(){
  return where().querySingle();
}

Fixed version (ground truth):
/** 
 * @return The first result of this query. It forces a {@link Where#limit(int)} of 1 for more efficient querying.
 */
@Override public ModelClass querySingle(){
  return where().querySingle();
}
Program: 27002
Project: 27002
Buggy source:
/** 
 * Begins an INDEXED BY piece of this query with the specified name.
 * @param indexName The name of the index.
 * @return An INDEXED BY piece of this statement
 */
public IndexedBy<ModelClass> indexedBy(String indexName){
  return new IndexedBy<>(indexName,this);
}

Fixed version (ground truth):
/** 
 * Begins an INDEXED BY piece of this query with the specified name.
 * @param indexProperty The index property generated.
 * @return An INDEXED BY piece of this statement
 */
public IndexedBy<ModelClass> indexedBy(IndexProperty<ModelClass> indexProperty){
  return new IndexedBy<>(indexProperty,this);
}
Program: 27003
Project: 27003
Buggy source:
public ContentUriDefinition(Element typeElement,ProcessorManager processorManager){
  super(typeElement,processorManager);
  ContentUri contentUri=typeElement.getAnnotation(ContentUri.class);
  path=contentUri.path();
  type=contentUri.type();
  name=typeElement.getEnclosingElement().getSimpleName().toString() + "String_Node_Str" + typeElement.getSimpleName().toString();
  queryEnabled=contentUri.queryEnabled();
  insertEnabled=contentUri.insertEnabled();
  deleteEnabled=contentUri.deleteEnabled();
  updateEnabled=contentUri.updateEnabled();
  segments=contentUri.segments();
  if (typeElement instanceof VariableElement) {
    TypeMirror typeMirror=typeElement.asType();
    if (!ClassNames.URI.equals(typeMirror.toString())) {
      processorManager.logError("String_Node_Str");
    }
  }
 else   if (typeElement instanceof ExecutableElement) {
    TypeMirror typeMirror=((ExecutableElement)typeElement).getReturnType();
    if (!ClassNames.URI.equals(typeMirror.toString())) {
      processorManager.logError("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
public ContentUriDefinition(Element typeElement,ProcessorManager processorManager){
  super(typeElement,processorManager);
  ContentUri contentUri=typeElement.getAnnotation(ContentUri.class);
  path=contentUri.path();
  type=contentUri.type();
  name=typeElement.getEnclosingElement().getSimpleName().toString() + "String_Node_Str" + typeElement.getSimpleName().toString();
  queryEnabled=contentUri.queryEnabled();
  insertEnabled=contentUri.insertEnabled();
  deleteEnabled=contentUri.deleteEnabled();
  updateEnabled=contentUri.updateEnabled();
  segments=contentUri.segments();
  if (typeElement instanceof VariableElement) {
    if (!ClassNames.URI.equals(elementTypeName)) {
      processorManager.logError("String_Node_Str");
    }
  }
 else   if (typeElement instanceof ExecutableElement) {
    if (!ClassNames.URI.equals(elementTypeName)) {
      processorManager.logError("String_Node_Str");
    }
  }
}
Program: 27004
Project: 27004
Buggy source:
public String getQuery(boolean useCastIfApplicable){
  AdapterQueryBuilder contentValue=new AdapterQueryBuilder();
  if (!requiresTypeConverter) {
    if (castedClass != null && useCastIfApplicable) {
      contentValue.appendCast(isABlob ? "String_Node_Str" : castedClass);
    }
 else {
      contentValue.append("String_Node_Str");
    }
  }
  contentValue.appendVariable(isModelContainerAdapter).append("String_Node_Str");
  if (isModelContainerAdapter) {
    contentValue.appendGetValue(containerKeyName);
  }
 else   if (fieldIsAModelContainer) {
    contentValue.append(columnName).append("String_Node_Str").appendGetValue(referencedColumnFieldName);
  }
 else {
    if (isForeignKeyField) {
      ColumnAccessModel columnAccessModel=new ColumnAccessModel(parentColumnDefinition.getManager(),parentColumnDefinition,isModelContainerAdapter);
      contentValue.append(columnAccessModel.getReferencedColumnFieldName()).append("String_Node_Str");
    }
    contentValue.append(getReferencedColumnFieldName());
  }
  if (isABlob) {
    contentValue.append("String_Node_Str");
  }
  if (!requiresTypeConverter) {
    contentValue.append("String_Node_Str");
  }
  return contentValue.getQuery();
}

Fixed version (ground truth):
public String getQuery(boolean useCastIfApplicable){
  AdapterQueryBuilder contentValue=new AdapterQueryBuilder();
  if (!requiresTypeConverter) {
    if (castedClass != null && useCastIfApplicable) {
      contentValue.appendCast(isABlob ? "String_Node_Str" : castedClass);
    }
 else {
      contentValue.append("String_Node_Str");
    }
  }
  contentValue.appendVariable(isModelContainerAdapter).append("String_Node_Str");
  if (isModelContainerAdapter) {
    contentValue.appendGetValue(containerKeyName);
  }
 else   if (fieldIsAModelContainer) {
    contentValue.append(columnName).append("String_Node_Str").appendGetValue(referencedColumnFieldName);
  }
 else {
    if (isForeignKeyField) {
      ColumnAccessModel columnAccessModel=new ColumnAccessModel(parentColumnDefinition.getManager(),parentColumnDefinition,isModelContainerAdapter);
      contentValue.append(columnAccessModel.getReferencedColumnFieldName()).append("String_Node_Str");
    }
    contentValue.append(getReferencedColumnFieldName());
  }
  if (isABlob && !isModelContainerAdapter) {
    contentValue.append("String_Node_Str");
  }
  if (!requiresTypeConverter) {
    contentValue.append("String_Node_Str");
  }
  return contentValue.getQuery();
}
Program: 27007
Project: 27007
Buggy source:
/** 
 * @param functionName  The name of the function to call as the {@link Condition#column(ColumnAlias)}
 * @param columnAliases The alias' of columns to use as parameters to the specified function.
 * @return Creates a new instance with function name that quotes the specified columns.EX: date(`myColumn`) -&gt; ColumnAlias.columnsWithFunction("date", ColumnAlias.column("myColumn"))
 */
public static ColumnAlias columnsWithFunction(String functionName,ColumnAlias... columnAliases){
  return columnRaw(functionName + "String_Node_Str" + QueryBuilder.join("String_Node_Str",columnAliases)+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param functionName  The name of the function to call as the {@link Condition#column(ColumnAlias)}
 * @param columnAliases The alias' of columns to use as parameters to the specified function.
 * @return Creates a new instance with function name that quotes the specified columns.EX: date(`myColumn`) -&gt; ColumnAlias.columnsWithFunction("date", ColumnAlias.column("myColumn"))
 */
public static ColumnAlias columnsWithFunction(String functionName,ColumnAlias... columnAliases){
  QueryBuilder queryBuilder=new QueryBuilder<>(functionName).append("String_Node_Str");
  for (int i=0; i < columnAliases.length; i++) {
    if (i > 0) {
      queryBuilder.append("String_Node_Str");
    }
    queryBuilder.appendQuoted(columnAliases[i].getAliasName());
  }
  queryBuilder.append("String_Node_Str");
  return columnRaw(queryBuilder.getQuery());
}
Program: 27008
Project: 27008
Buggy source:
/** 
 * @param functionName  The name of the function to call as the {@link Condition#column(ColumnAlias)}
 * @param columnAliases The alias' of columns to use as parameters to the specified function.
 * @return Creates a new instance with function name that quotes the specified columns.EX: date(`myColumn`) -&gt; ColumnAlias.columnsWithFunction("date", ColumnAlias.column("myColumn"))
 */
public static ColumnAlias columnsWithFunction(String functionName,ColumnAlias... columnAliases){
  QueryBuilder queryBuilder=new QueryBuilder<>(functionName).append("String_Node_Str");
  for (int i=0; i < columnAliases.length; i++) {
    if (i > 0) {
      queryBuilder.append("String_Node_Str");
    }
    queryBuilder.appendQuoted(columnAliases[i].getAliasName());
  }
  queryBuilder.append("String_Node_Str");
  return columnRaw(queryBuilder.getQuery());
}

Fixed version (ground truth):
/** 
 * @param functionName  The name of the function to call as the {@link Condition#column(ColumnAlias)}
 * @param columnAliases The alias' of columns to use as parameters to the specified function.
 * @return Creates a new instance with function name that quotes the specified columns.EX: date(`myColumn`) -&gt; ColumnAlias.columnsWithFunction("date", ColumnAlias.column("myColumn"))
 */
public static ColumnAlias columnsWithFunction(String functionName,ColumnAlias... columnAliases){
  QueryBuilder queryBuilder=new QueryBuilder<>(functionName).append("String_Node_Str");
  for (int i=0; i < columnAliases.length; i++) {
    if (i > 0) {
      queryBuilder.append("String_Node_Str");
    }
    queryBuilder.append(columnAliases[i].getAliasName());
  }
  queryBuilder.append("String_Node_Str");
  return columnRaw(queryBuilder.getQuery());
}
Program: 27009
Project: 27009
Buggy source:
public void writeToModelDefinition(JavaWriter javaWriter) throws IOException {
  if (!isModel) {
    AdapterQueryBuilder adapterQueryBuilder=new AdapterQueryBuilder("String_Node_Str");
    adapterQueryBuilder.append(columnFieldName).appendSpaceSeparated("String_Node_Str").appendVariable(true).append("String_Node_Str").appendGetValue(containerKeyName);
    javaWriter.emitStatement(adapterQueryBuilder.getQuery());
    javaWriter.beginControlFlow("String_Node_Str",columnFieldName);
  }
  AdapterQueryBuilder queryBuilder=new AdapterQueryBuilder();
  queryBuilder.appendVariable(false).append("String_Node_Str").append(columnFieldName);
  queryBuilder.appendSpaceSeparated("String_Node_Str");
  String getType=columnFieldType;
  if (element.asType().getKind().isPrimitive()) {
    getType=manager.getTypeUtils().boxedClass((PrimitiveType)element.asType()).asType().toString();
  }
  queryBuilder.appendCast(fieldIsModelContainer ? modelContainerType : getType);
  if (isModel) {
    queryBuilder.appendVariable(true).append("String_Node_Str");
    queryBuilder.appendVariable(true).append("String_Node_Str").appendGetValue(containerKeyName);
    queryBuilder.append("String_Node_Str").append(ModelUtils.getFieldClass(columnFieldType)).append("String_Node_Str").append("String_Node_Str");
  }
 else {
    queryBuilder.append(String.format("String_Node_Str",columnFieldName));
  }
  javaWriter.emitStatement(queryBuilder.getQuery());
  if (!isModel) {
    javaWriter.endControlFlow();
  }
}

Fixed version (ground truth):
public void writeToModelDefinition(JavaWriter javaWriter,boolean isModelContainerAdapter) throws IOException {
  if (!isModel) {
    AdapterQueryBuilder adapterQueryBuilder=new AdapterQueryBuilder("String_Node_Str");
    adapterQueryBuilder.append(columnFieldName).appendSpaceSeparated("String_Node_Str").appendVariable(true).append("String_Node_Str").appendGetValue(containerKeyName);
    javaWriter.emitStatement(adapterQueryBuilder.getQuery());
    javaWriter.beginControlFlow("String_Node_Str",columnFieldName);
  }
  ColumnAccessModel columnAccessModel=new ColumnAccessModel(manager,this,isModelContainerAdapter);
  AdapterQueryBuilder queryBuilder=new AdapterQueryBuilder();
  queryBuilder.appendVariable(false).append("String_Node_Str").append(columnFieldName);
  queryBuilder.appendSpaceSeparated("String_Node_Str");
  String getType=columnFieldType;
  if (element.asType().getKind().isPrimitive()) {
    getType=manager.getTypeUtils().boxedClass((PrimitiveType)element.asType()).asType().toString();
  }
  queryBuilder.appendCast(fieldIsModelContainer ? modelContainerType : getType);
  if (isModel) {
    queryBuilder.appendVariable(true).append("String_Node_Str");
    queryBuilder.appendVariable(true).append("String_Node_Str").appendGetValue(containerKeyName);
    queryBuilder.append("String_Node_Str").append(ModelUtils.getFieldClass(columnFieldType)).append("String_Node_Str").append("String_Node_Str");
  }
 else {
    queryBuilder.append(String.format("String_Node_Str",columnFieldName));
  }
  javaWriter.emitStatement(queryBuilder.getQuery());
  if (!isModel) {
    javaWriter.endControlFlow();
  }
}
Program: 27011
Project: 27011
Buggy source:
@Override public void write(JavaWriter javaWriter) throws IOException {
  javaWriter.emitStatement(tableDefinition.getModelClassName() + "String_Node_Str" + ModelUtils.getVariable(false)+ "String_Node_Str"+ tableDefinition.getModelClassName()+ "String_Node_Str");
  for (  ColumnDefinition columnDefinition : tableDefinition.getColumnDefinitions()) {
    columnDefinition.writeToModelDefinition(javaWriter);
  }
  javaWriter.emitStatement("String_Node_Str" + ModelUtils.getVariable(false));
}

Fixed version (ground truth):
@Override public void write(JavaWriter javaWriter) throws IOException {
  javaWriter.emitStatement(tableDefinition.getModelClassName() + "String_Node_Str" + ModelUtils.getVariable(false)+ "String_Node_Str"+ tableDefinition.getModelClassName()+ "String_Node_Str");
  for (  ColumnDefinition columnDefinition : tableDefinition.getColumnDefinitions()) {
    columnDefinition.writeToModelDefinition(javaWriter,isModelContainerDefinition);
  }
  javaWriter.emitStatement("String_Node_Str" + ModelUtils.getVariable(false));
}
Program: 27015
Project: 27015
Buggy source:
@Override public void write(JavaWriter javaWriter) throws IOException {
  if (isModelContainerAdapter) {
    AdapterQueryBuilder adapterQueryBuilder=new AdapterQueryBuilder();
    adapterQueryBuilder.append(modelContainerName).appendPut(accessModel.getReferencedColumnFieldName()).append(ModelUtils.getCursorStatement(accessModel.castedClass,accessModel.foreignKeyLocalColumnName)).append("String_Node_Str");
    javaWriter.emitStatement(adapterQueryBuilder.getQuery());
  }
 else {
    String cursorStatementClass=accessModel.castedClass;
    if (accessModel.isEnum) {
      cursorStatementClass=String.class.getName();
    }
    String cursorStatment=ModelUtils.getCursorStatement(cursorStatementClass,accessModel.foreignKeyLocalColumnName);
    emitColumnAssignment(javaWriter,cursorStatment);
  }
}

Fixed version (ground truth):
@Override public void write(JavaWriter javaWriter) throws IOException {
  String cursorStatementClass=accessModel.castedClass;
  if (accessModel.isEnum) {
    cursorStatementClass=String.class.getName();
  }
  String cursorStatment=ModelUtils.getCursorStatement(cursorStatementClass,accessModel.foreignKeyLocalColumnName);
  emitColumnAssignment(javaWriter,cursorStatment);
}
Program: 27016
Project: 27016
Buggy source:
/** 
 * Appends a value only if it's not empty or null
 * @param name  The name of the qualifier
 * @param value The value to append after the name
 * @return This instance
 */
public QueryClass appendQualifier(String name,String value){
  if (value != null && value.length() > 0) {
    append(name).appendSpaceSeparated(value);
  }
  return castThis();
}

Fixed version (ground truth):
/** 
 * Appends a value only if it's not empty or null
 * @param name  The name of the qualifier
 * @param value The value to append after the name
 * @return This instance
 */
public QueryClass appendQualifier(String name,String value){
  if (value != null && value.length() > 0) {
    if (name != null) {
      append(name);
    }
    appendSpaceSeparated(value);
  }
  return castThis();
}
Program: 27017
Project: 27017
Buggy source:
/** 
 * Appends the string with spaces on the front and end of the string
 * @param string The string to append
 * @return This instance
 */
@SuppressWarnings("String_Node_Str") public QueryClass appendSpaceSeparated(String string){
  return (QueryClass)appendSpace().append(string).appendSpace();
}

Fixed version (ground truth):
/** 
 * Appends the string with spaces on the front and end of the string
 * @param object The object to append
 * @return This instance
 */
@SuppressWarnings("String_Node_Str") public QueryClass appendSpaceSeparated(Object object){
  return (QueryClass)appendSpace().append(object).appendSpace();
}
Program: 27018
Project: 27018
Buggy source:
@Override public String getQuery(){
  QueryBuilder queryBuilder=new QueryBuilder("String_Node_Str");
  for (int i=0; i < columnAliasList.size(); i++) {
    if (i > 0) {
      queryBuilder.append("String_Node_Str");
    }
    queryBuilder.append(columnAliasList.get(i).getAliasName());
  }
  queryBuilder.appendSpace().append(ascending ? "String_Node_Str" : "String_Node_Str");
  return queryBuilder.getQuery();
}

Fixed version (ground truth):
@Override public String getQuery(){
  QueryBuilder queryBuilder=new QueryBuilder("String_Node_Str");
  if (!TextUtils.isEmpty(stringOrderBy)) {
    queryBuilder.append(stringOrderBy);
  }
 else {
    for (int i=0; i < columnAliasList.size(); i++) {
      if (i > 0) {
        queryBuilder.append("String_Node_Str");
      }
      queryBuilder.append(columnAliasList.get(i).getAliasName());
    }
    queryBuilder.appendSpace().append(ascending ? "String_Node_Str" : "String_Node_Str");
    if (orderByCollation != null) {
      queryBuilder.appendSpace().appendSpaceSeparated(orderByCollation);
    }
  }
  return queryBuilder.getQuery();
}
Program: 27019
Project: 27019
Buggy source:
@Override public String getQuery(){
  String fromQuery=whereBase.getQuery();
  QueryBuilder queryBuilder=new QueryBuilder().append(fromQuery).appendQualifier("String_Node_Str",conditionQueryBuilder.getQuery()).appendQualifier("String_Node_Str",groupBy).appendQualifier("String_Node_Str",having.getQuery()).appendQualifier("String_Node_Str",orderBy).appendQualifier("String_Node_Str",limit).appendQualifier("String_Node_Str",offset);
  if (FlowLog.isEnabled(FlowLog.Level.V)) {
    FlowLog.log(FlowLog.Level.V,queryBuilder.getQuery());
  }
  return queryBuilder.getQuery();
}

Fixed version (ground truth):
@Override public String getQuery(){
  String fromQuery=whereBase.getQuery();
  QueryBuilder queryBuilder=new QueryBuilder().append(fromQuery).appendQualifier("String_Node_Str",conditionQueryBuilder.getQuery()).appendQualifier("String_Node_Str",groupBy).appendQualifier("String_Node_Str",having.getQuery()).appendQualifier(null,orderBy).appendQualifier("String_Node_Str",limit).appendQualifier("String_Node_Str",offset);
  if (FlowLog.isEnabled(FlowLog.Level.V)) {
    FlowLog.log(FlowLog.Level.V,queryBuilder.getQuery());
  }
  return queryBuilder.getQuery();
}
Program: 27020
Project: 27020
Buggy source:
@Override public String getQuery(){
  QueryBuilder queryBuilder=new QueryBuilder("String_Node_Str");
  if (!TextUtils.isEmpty(stringOrderBy)) {
    queryBuilder.append(stringOrderBy);
  }
 else {
    for (int i=0; i < columnAliasList.size(); i++) {
      if (i > 0) {
        queryBuilder.append("String_Node_Str");
      }
      queryBuilder.append(columnAliasList.get(i).getAliasName());
    }
    queryBuilder.appendSpace().append(ascending ? "String_Node_Str" : "String_Node_Str");
    if (orderByCollation != null) {
      queryBuilder.appendSpace().appendSpaceSeparated(orderByCollation);
    }
  }
  return queryBuilder.getQuery();
}

Fixed version (ground truth):
@Override public String getQuery(){
  QueryBuilder queryBuilder=new QueryBuilder("String_Node_Str");
  if (!TextUtils.isEmpty(stringOrderBy)) {
    queryBuilder.append(stringOrderBy);
  }
 else {
    for (int i=0; i < columnAliasList.size(); i++) {
      if (i > 0) {
        queryBuilder.append("String_Node_Str");
      }
      queryBuilder.append(columnAliasList.get(i).getAliasName());
    }
    queryBuilder.appendSpace().append(ascending ? "String_Node_Str" : "String_Node_Str");
    if (orderByCollation != null) {
      queryBuilder.appendSpace().append("String_Node_Str").appendSpaceSeparated(orderByCollation);
    }
  }
  return queryBuilder.getQuery();
}
Program: 27021
Project: 27021
Buggy source:
/** 
 * Ends the transaction where it finishes, and will call   {@link #onChange(boolean,Uri)} for Jelly Bean and up forevery URI called (if set), or  {@link #onChange(boolean)} once for lower than Jelly bean.
 */
public void endTransactionAndNotify(){
  if (isInTransaction) {
    isInTransaction=false;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      onChange(true);
    }
 else {
synchronized (notificationUris) {
        for (        Uri uri : notificationUris) {
          onChange(true,uri);
        }
        notificationUris.clear();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Ends the transaction where it finishes, and will call   {@link #onChange(boolean,Uri)} for Jelly Bean and up forevery URI called (if set), or  {@link #onChange(boolean)} once for lower than Jelly bean.
 */
public void endTransactionAndNotify(){
  if (isInTransaction) {
    isInTransaction=false;
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
      onChange(true);
    }
 else {
synchronized (notificationUris) {
        for (        Uri uri : notificationUris) {
          onChange(true,uri);
        }
        notificationUris.clear();
      }
    }
  }
}
Program: 27022
Project: 27022
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public List<ModelClass> onExecute(){
  if (contentObserver != null) {
    contentObserver.beginTransaction();
  }
  processModelInfo.processModels(this);
  List<ModelClass> models=processModelInfo.models;
  if (contentObserver != null) {
    contentObserver.endTransactionAndNotify();
  }
  return models;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public List<ModelClass> onExecute(){
  if (contentObserver != null) {
    contentObserver.beginTransaction();
  }
  processModelInfo.processModels(new ProcessModel<ModelClass>(){
    @Override public void processModel(    ModelClass model){
      ProcessModelTransaction.this.processModel(model);
      count++;
      if (changeListener != null) {
        changeListener.onProcessProgressChange(count,totalCount,model);
      }
    }
  }
);
  List<ModelClass> models=processModelInfo.models;
  if (contentObserver != null) {
    contentObserver.endTransactionAndNotify();
  }
  return models;
}
Program: 27023
Project: 27023
Buggy source:
/** 
 * Constructs this transaction with a single model enabled.
 * @param modelInfo       Holds information about this process request
 * @param contentObserver The optional {@link FlowContentObserver} to wrap the process in a transaction.
 */
public ProcessModelTransaction(ProcessModelInfo<ModelClass> modelInfo,FlowContentObserver contentObserver){
  super(modelInfo.getInfo(),modelInfo.transactionListener);
  processModelInfo=modelInfo;
  this.contentObserver=contentObserver;
}

Fixed version (ground truth):
/** 
 * Constructs this transaction with a single model enabled.
 * @param modelInfo       Holds information about this process request
 * @param contentObserver The optional {@link FlowContentObserver} to wrap the process in a transaction.
 */
public ProcessModelTransaction(ProcessModelInfo<ModelClass> modelInfo,FlowContentObserver contentObserver){
  super(modelInfo.getInfo(),modelInfo.transactionListener);
  processModelInfo=modelInfo;
  this.contentObserver=contentObserver;
  totalCount=processModelInfo.models.size();
}
Program: 27024
Project: 27024
Buggy source:
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) @Override public void onChange(boolean selfChange,Uri uri){
  String fragment=uri.getFragment();
  String tableName=uri.getAuthority();
  String columnName=null;
  String param=null;
  Set<String> queryNames=uri.getQueryParameterNames();
  if (!queryNames.isEmpty()) {
    for (    String key : queryNames) {
      param=uri.getQueryParameter(key);
      columnName=key;
      break;
    }
  }
  Class<? extends Model> table=registeredTables.get(tableName);
  if (!isInTransaction) {
    BaseModel.Action action=BaseModel.Action.valueOf(fragment);
    if (action != null) {
      for (      OnModelStateChangedListener modelChangeListener : modelChangeListeners) {
        modelChangeListener.onModelStateChanged(table,action);
      }
      if (columnName != null && param != null) {
        for (        OnSpecificModelStateChangedListener modelChangeListener : specificModelChangeListeners) {
          modelChangeListener.onModelStateChanged(table,action,columnName,param);
        }
      }
    }
  }
 else {
    if (!notifyAllUris) {
      uri=SqlUtils.getNotificationUri(table,BaseModel.Action.CHANGE);
    }
synchronized (notificationUris) {
      notificationUris.add(uri);
    }
  }
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) @Override public void onChange(boolean selfChange,Uri uri){
  String fragment=uri.getFragment();
  String tableName=uri.getAuthority();
  String columnName=null;
  String param=null;
  Set<String> queryNames=uri.getQueryParameterNames();
  if (!queryNames.isEmpty()) {
    for (    String key : queryNames) {
      param=Uri.decode(uri.getQueryParameter(key));
      columnName=key;
      break;
    }
  }
  Class<? extends Model> table=registeredTables.get(tableName);
  if (!isInTransaction) {
    BaseModel.Action action=BaseModel.Action.valueOf(fragment);
    if (action != null) {
      for (      OnModelStateChangedListener modelChangeListener : modelChangeListeners) {
        modelChangeListener.onModelStateChanged(table,action);
      }
      if (columnName != null && param != null) {
        for (        OnSpecificModelStateChangedListener modelChangeListener : specificModelChangeListeners) {
          modelChangeListener.onModelStateChanged(table,action,columnName,param);
        }
      }
    }
  }
 else {
    if (!notifyAllUris) {
      uri=SqlUtils.getNotificationUri(table,BaseModel.Action.CHANGE);
    }
synchronized (notificationUris) {
      notificationUris.add(uri);
    }
  }
}