nus-yam/ex-repair huggingface dataset:
Program: 26730
Project: 26730
Buggy source:
/** 
 * Called when the operation to write to a beacon's GATT service has completed.
 * @param bluetoothGattCharacteristic
 */
private static void onNearbyBeaconsGattCharacteristicWrite(BluetoothGattCharacteristic bluetoothGattCharacteristic){
  if (bluetoothGattCharacteristic.getUuid().equals(UUID_BEACON_DATA_PART_1)) {
    handleGattCharacteristicWrite_beaconDataPart1(bluetoothGattCharacteristic);
  }
 else   if (bluetoothGattCharacteristic.getUuid().equals(UUID_BEACON_DATA_PART_2)) {
    handleGattCharacteristicWrite_beaconDataPart2(bluetoothGattCharacteristic);
  }
}

Fixed version (ground truth):
/** 
 * Called when the operation to write to a beacon's GATT service has completed.
 * @param bluetoothGattCharacteristic Characteristic that was written to the associated remote device.
 */
private static void onNearbyBeaconsGattCharacteristicWrite(BluetoothGattCharacteristic bluetoothGattCharacteristic){
  if (bluetoothGattCharacteristic.getUuid().equals(UUID_BEACON_DATA_PART_1)) {
    handleGattCharacteristicWrite_beaconDataPart1(bluetoothGattCharacteristic);
  }
 else   if (bluetoothGattCharacteristic.getUuid().equals(UUID_BEACON_DATA_PART_2)) {
    handleGattCharacteristicWrite_beaconDataPart2(bluetoothGattCharacteristic);
  }
}
Program: 26731
Project: 26731
Buggy source:
/** 
 * Connect to the nearby beacon's GATT service.
 * @param context
 * @param beaconBluetoothDevice
 */
private static void connectToNearbyBeacon(Context context,BluetoothDevice beaconBluetoothDevice){
  mBluetoothGatt=beaconBluetoothDevice.connectGatt(context,true,mBluetoothGattCallback);
}

Fixed version (ground truth):
/** 
 * Connect to the nearby beacon's GATT service.
 * @param context
 * @param beaconBluetoothDevice Device hosting the GATT Server
 */
private static void connectToNearbyBeacon(Context context,BluetoothDevice beaconBluetoothDevice){
  mBluetoothGatt=beaconBluetoothDevice.connectGatt(context,true,mBluetoothGattCallback);
}
Program: 26732
Project: 26732
Buggy source:
/** 
 * Create a beacon advertising packet that will contain the given url.
 * @param url
 * @return
 * @throws IOException
 */
public static byte[] createAdvertisingPacket(String url) throws IOException {
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  byte[] url_bytes=createUrlBytes(url);
  byte length=(byte)(URI_SERVICE_DATA_HEADER.length + url_bytes.length);
  outputStream.write(ADVERTISING_PACKET_HEADER);
  outputStream.write(length);
  outputStream.write(URI_SERVICE_DATA_HEADER);
  outputStream.write(url_bytes);
  return outputStream.toByteArray();
}

Fixed version (ground truth):
/** 
 * Create a beacon advertising packet that will contain the given url.
 * @param url Url to write to the beacon
 * @return the encoded url
 * @throws IOException
 */
public static byte[] createAdvertisingPacket(String url) throws IOException {
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  byte[] url_bytes=createUrlBytes(url);
  byte length=(byte)(URI_SERVICE_DATA_HEADER.length + url_bytes.length);
  outputStream.write(ADVERTISING_PACKET_HEADER);
  outputStream.write(length);
  outputStream.write(URI_SERVICE_DATA_HEADER);
  outputStream.write(url_bytes);
  return outputStream.toByteArray();
}
Program: 26733
Project: 26733
Buggy source:
/** 
 * Create the byte array that represents the given url. This process first compresses the url using the expansion codes. Then if the url is still too long, we shorten it with a url shortener. Then we compress that url using the expansion codes again.
 * @param url
 * @return
 * @throws IOException
 */
public static byte[] createUrlBytes(String url) throws IOException {
  byte[] url_bytes;
  url_bytes=compressUrlUsingExpansionCodes(url);
  if (url_bytes.length > MAX_NUM_BYTES_URL) {
    String url_shortened=UrlShortener.shortenUrl(url);
    url_bytes=compressUrlUsingExpansionCodes(url_shortened);
  }
  return url_bytes;
}

Fixed version (ground truth):
/** 
 * Create the byte array that represents the given url. This process first compresses the url using the expansion codes. Then if the url is still too long, we shorten it with a url shortener. Then we compress that url using the expansion codes again.
 * @param url URL to encode
 * @return encoded URL
 * @throws IOException
 */
public static byte[] createUrlBytes(String url) throws IOException {
  byte[] url_bytes;
  url_bytes=compressUrlUsingExpansionCodes(url);
  if (url_bytes.length > MAX_NUM_BYTES_URL) {
    String url_shortened=UrlShortener.shortenUrl(url);
    url_bytes=compressUrlUsingExpansionCodes(url_shortened);
  }
  return url_bytes;
}
Program: 26734
Project: 26734
Buggy source:
/** 
 * Compress the given url by looking for a hardcoded set of substrings (e.g. http://, .edu, etc.) and replacing them with an associated integer.
 * @param url
 * @return
 * @throws IOException
 */
private static byte[] compressUrlUsingExpansionCodes(String url) throws IOException {
  String splitChar="String_Node_Str";
  String codeIndicatorChar="String_Node_Str";
  for (int i=0; i < EXPANSION_CODES_TO_TEXT_MAP.length; i++) {
    String text=EXPANSION_CODES_TO_TEXT_MAP[i];
    if (url.contains(text)) {
      String replacementText=splitChar + codeIndicatorChar + String.valueOf(i)+ splitChar;
      url=url.replace(text,replacementText);
    }
  }
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  String[] url_split=url.split(splitChar);
  for (  String subString : url_split) {
    if (subString.contains(codeIndicatorChar)) {
      int code=Integer.valueOf(subString.replace(codeIndicatorChar,"String_Node_Str"));
      outputStream.write((byte)code);
    }
 else {
      outputStream.write(subString.getBytes());
    }
  }
  byte[] url_bytes=outputStream.toByteArray();
  return url_bytes;
}

Fixed version (ground truth):
/** 
 * Compress the given url by looking for a hardcoded set of substrings (e.g. http://, .edu, etc.) and replacing them with an associated integer.
 * @param url URL to compress
 * @return Compressed URL
 * @throws IOException
 */
private static byte[] compressUrlUsingExpansionCodes(String url) throws IOException {
  String splitChar="String_Node_Str";
  String codeIndicatorChar="String_Node_Str";
  for (int i=0; i < EXPANSION_CODES_TO_TEXT_MAP.length; i++) {
    String text=EXPANSION_CODES_TO_TEXT_MAP[i];
    if (url.contains(text)) {
      String replacementText=splitChar + codeIndicatorChar + String.valueOf(i)+ splitChar;
      url=url.replace(text,replacementText);
    }
  }
  ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
  String[] url_split=url.split(splitChar);
  for (  String subString : url_split) {
    if (subString.contains(codeIndicatorChar)) {
      int code=Integer.valueOf(subString.replace(codeIndicatorChar,"String_Node_Str"));
      outputStream.write((byte)code);
    }
 else {
      outputStream.write(subString.getBytes());
    }
  }
  byte[] url_bytes=outputStream.toByteArray();
  return url_bytes;
}
Program: 26735
Project: 26735
Buggy source:
@Override public void onDestroy(){
  unregisterReceiver(mScreenStateBroadcastReceiver);
  stopSearchingForDevices();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  stopSearchingForDevices();
  unregisterReceiver(mScreenStateBroadcastReceiver);
}
Program: 26736
Project: 26736
Buggy source:
private void showNearbyBeaconsFragment(){
  getFragmentManager().beginTransaction().add(R.id.homeScreen_container,NearbyDevicesFragment.newInstance()).commit();
}

Fixed version (ground truth):
private void showNearbyBeaconsFragment(){
  getFragmentManager().beginTransaction().add(R.id.main_activity_container,NearbyDevicesFragment.newInstance()).commit();
}
Program: 26737
Project: 26737
Buggy source:
public void setAnimationsTarget(View view){
  mCollapseAlpha.setTarget(view);
  mCollapseDir.setTarget(view);
  mExpandAlpha.setTarget(view);
  mExpandDir.setTarget(view);
}

Fixed version (ground truth):
public void setAnimationsTarget(View view){
  mCollapseAlpha.setTarget(view);
  mCollapseDir.setTarget(view);
  mExpandAlpha.setTarget(view);
  mExpandDir.setTarget(view);
  mCollapseAnimation.play(mCollapseAlpha);
  mCollapseAnimation.play(mCollapseDir);
  mExpandAnimation.play(mExpandAlpha);
  mExpandAnimation.play(mExpandDir);
}
Program: 26738
Project: 26738
Buggy source:
public LayoutParams(ViewGroup.LayoutParams source){
  super(source);
  mExpandDir.setInterpolator(sExpandInterpolator);
  mExpandAlpha.setInterpolator(sAlphaExpandInterpolator);
  mCollapseDir.setInterpolator(sCollapseInterpolator);
  mCollapseAlpha.setInterpolator(sCollapseInterpolator);
  mCollapseAlpha.setProperty(View.ALPHA);
  mCollapseAlpha.setFloatValues(1f,0f);
  mExpandAlpha.setProperty(View.ALPHA);
  mExpandAlpha.setFloatValues(0f,1f);
switch (mExpandDirection) {
case EXPAND_UP:
case EXPAND_DOWN:
    mCollapseDir.setProperty(View.TRANSLATION_Y);
  mExpandDir.setProperty(View.TRANSLATION_Y);
break;
case EXPAND_LEFT:
case EXPAND_RIGHT:
mCollapseDir.setProperty(View.TRANSLATION_X);
mExpandDir.setProperty(View.TRANSLATION_X);
break;
}
mExpandAnimation.play(mExpandAlpha);
mExpandAnimation.play(mExpandDir);
mCollapseAnimation.play(mCollapseAlpha);
mCollapseAnimation.play(mCollapseDir);
}

Fixed version (ground truth):
public LayoutParams(ViewGroup.LayoutParams source){
  super(source);
  mExpandDir.setInterpolator(sExpandInterpolator);
  mExpandAlpha.setInterpolator(sAlphaExpandInterpolator);
  mCollapseDir.setInterpolator(sCollapseInterpolator);
  mCollapseAlpha.setInterpolator(sCollapseInterpolator);
  mCollapseAlpha.setProperty(View.ALPHA);
  mCollapseAlpha.setFloatValues(1f,0f);
  mExpandAlpha.setProperty(View.ALPHA);
  mExpandAlpha.setFloatValues(0f,1f);
switch (mExpandDirection) {
case EXPAND_UP:
case EXPAND_DOWN:
    mCollapseDir.setProperty(View.TRANSLATION_Y);
  mExpandDir.setProperty(View.TRANSLATION_Y);
break;
case EXPAND_LEFT:
case EXPAND_RIGHT:
mCollapseDir.setProperty(View.TRANSLATION_X);
mExpandDir.setProperty(View.TRANSLATION_X);
break;
}
}
Program: 26739
Project: 26739
Buggy source:
public void setIconDrawable(@NonNull Drawable iconDrawable){
  if (mIconDrawable != iconDrawable) {
    mIcon=0;
    updateIconDrawable(iconDrawable);
  }
}

Fixed version (ground truth):
public void setIconDrawable(@NonNull Drawable iconDrawable){
  if (mIconDrawable != iconDrawable) {
    mIcon=0;
    mIconDrawable=iconDrawable;
    updateBackground();
  }
}
Program: 26740
Project: 26740
Buggy source:
public void setIcon(@DrawableRes int icon){
  if (mIcon != icon) {
    mIcon=icon;
    updateIconDrawable(getResources().getDrawable(mIcon));
  }
}

Fixed version (ground truth):
public void setIcon(@DrawableRes int icon){
  if (mIcon != icon) {
    mIcon=icon;
    mIconDrawable=null;
    updateBackground();
  }
}
Program: 26741
Project: 26741
Buggy source:
Drawable getIconDrawable(){
  return mIconDrawable != null ? mIconDrawable : new ColorDrawable(Color.TRANSPARENT);
}

Fixed version (ground truth):
Drawable getIconDrawable(){
  if (mIconDrawable != null) {
    return mIconDrawable;
  }
 else   if (mIcon != 0) {
    return getResources().getDrawable(mIcon);
  }
 else {
    return new ColorDrawable(Color.TRANSPARENT);
  }
}
Program: 26742
Project: 26742
Buggy source:
/** 
 * @return the current Color for nomal state. Note it returns the color and not the resource!
 */
public int getColorNormal(){
  return mColorNormal;
}

Fixed version (ground truth):
/** 
 * @return the current Color for normal state.
 */
public int getColorNormal(){
  return mColorNormal;
}
Program: 26743
Project: 26743
Buggy source:
public void setColorPressed(@ColorRes int colorPressed){
  this.mColorPressed=getColor(colorPressed);
  updateBackground();
}

Fixed version (ground truth):
public void setColorPressed(@ColorRes int colorPressed){
  mColorPressed=getColor(colorPressed);
  updateBackground();
}
Program: 26744
Project: 26744
Buggy source:
/** 
 * @return the current color for pressed state. note that it returns the color and not the resource
 */
public int getColorPressed(){
  return mColorPressed;
}

Fixed version (ground truth):
/** 
 * @return the current color for pressed state.
 */
public int getColorPressed(){
  return mColorPressed;
}
Program: 26745
Project: 26745
Buggy source:
public void setIcon(@DrawableRes int mIcon){
  if (this.mIcon != mIcon) {
    this.mIcon=mIcon;
    updateBackground();
  }
}

Fixed version (ground truth):
public void setIcon(@DrawableRes int icon){
  if (mIcon != icon) {
    mIcon=icon;
    updateBackground();
  }
}
Program: 26746
Project: 26746
Buggy source:
public void setColorNormal(@ColorRes int colorNormal){
  this.mColorNormal=getColor(colorNormal);
  updateBackground();
}

Fixed version (ground truth):
public void setColorNormal(@ColorRes int colorNormal){
  mColorNormal=getColor(colorNormal);
  updateBackground();
}
Program: 26747
Project: 26747
Buggy source:
public void setSize(int size){
  if (this.mSize != size) {
    this.mSize=size;
    updateCircleSize();
    updateDrawableSize();
    updateBackground();
  }
}

Fixed version (ground truth):
public void setSize(int size){
  if (mSize != size) {
    mSize=size;
    updateCircleSize();
    updateDrawableSize();
    updateBackground();
  }
}
Program: 26748
Project: 26748
Buggy source:
@Override public long executeUpdateDelete(@NonNull DatabaseWrapper databaseWrapper){
  long affected=databaseWrapper.compileStatement(getQuery()).executeUpdateDelete();
  if (affected > 0) {
    NotifyDistributor.get().notifyTableChanged(getTable(),getPrimaryAction());
  }
  return affected;
}

Fixed version (ground truth):
@Override public long executeUpdateDelete(@NonNull DatabaseWrapper databaseWrapper){
  final DatabaseStatement statement=databaseWrapper.compileStatement(getQuery());
  long affected;
  try {
    affected=statement.executeUpdateDelete();
    if (affected > 0) {
      NotifyDistributor.get().notifyTableChanged(getTable(),getPrimaryAction());
    }
  }
  finally {
    statement.close();
  }
  return affected;
}
Program: 26749
Project: 26749
Buggy source:
@Override public long executeInsert(@NonNull DatabaseWrapper databaseWrapper){
  return compileStatement().executeInsert();
}

Fixed version (ground truth):
@Override public long executeInsert(@NonNull DatabaseWrapper databaseWrapper){
  DatabaseStatement statement=compileStatement(databaseWrapper);
  long rows;
  try {
    rows=statement.executeInsert();
  }
  finally {
    statement.close();
  }
  return rows;
}
Program: 26750
Project: 26750
Buggy source:
@Override public Observable<Long> executeUpdateDelete(){
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Single<Long> executeUpdateDelete(){
  throw new IllegalStateException("String_Node_Str");
}
Program: 26751
Project: 26751
Buggy source:
public RXRetrievalAdapter(Class<TModel> table){
  this(FlowManager.getInstanceAdapter(table));
}

Fixed version (ground truth):
RXRetrievalAdapter(Class<TModel> table){
  this(FlowManager.getInstanceAdapter(table));
}
Program: 26752
Project: 26752
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.
 */
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");
}

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){
  return append(property,"String_Node_Str");
}
Program: 26753
Project: 26753
Buggy source:
/** 
 * Appends a property with the specified operation that separates it. The operation will appear before the property specified.
 */
public Method append(IProperty property,String operation){
  propertyList.add(property);
  operationsList.add(operation);
  return this;
}

Fixed version (ground truth):
/** 
 * Appends a property with the specified operation that separates it. The operation will appear before the property specified.
 */
public Method append(IProperty property,String operation){
  if (propertyList.size() == 1 && propertyList.get(0) == Property.ALL_PROPERTY) {
    propertyList.remove(0);
  }
  propertyList.add(property);
  operationsList.add(operation);
  return this;
}
Program: 26754
Project: 26754
Buggy source:
public Builder(@NonNull ModelQueriable<TModel> modelQueriable){
  this(modelQueriable.getTable());
  modelQueriable(modelQueriable);
}

Fixed version (ground truth):
public Builder(@Nullable ModelQueriable<TModel> modelQueriable){
  if (modelQueriable != null) {
    this.modelClass=modelQueriable.getTable();
  }
  modelQueriable(modelQueriable);
}
Program: 26755
Project: 26755
Buggy source:
/** 
 * Refreshes the data backing this list, and destroys the Model cache.
 */
public synchronized void refresh(){
  warnEmptyCursor();
  if (cursor != null) {
    cursor.close();
  }
  cursor=modelQueriable.query();
  if (cacheModels) {
    modelCache.clear();
    setCacheModels(true,cursor == null ? 0 : cursor.getCount());
  }
synchronized (cursorRefreshListenerSet) {
    for (    OnCursorRefreshListener<TModel> listener : cursorRefreshListenerSet) {
      listener.onCursorRefreshed(this);
    }
  }
}

Fixed version (ground truth):
/** 
 * Refreshes the data backing this list, and destroys the Model cache.
 */
public synchronized void refresh(){
  warnEmptyCursor();
  if (cursor != null) {
    cursor.close();
  }
  if (modelQueriable == null) {
    throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
  }
  cursor=modelQueriable.query();
  if (cacheModels) {
    modelCache.clear();
    setCacheModels(true,cursor == null ? 0 : cursor.getCount());
  }
synchronized (cursorRefreshListenerSet) {
    for (    OnCursorRefreshListener<TModel> listener : cursorRefreshListenerSet) {
      listener.onCursorRefreshed(this);
    }
  }
}
Program: 26756
Project: 26756
Buggy source:
@SuppressWarnings("String_Node_Str") public synchronized boolean delete(@NonNull TModel model,@NonNull DatabaseWrapper wrapper){
  modelAdapter.deleteForeignKeys(model,wrapper);
  boolean successful=SQLite.delete(modelAdapter.getModelClass()).where(modelAdapter.getPrimaryConditionClause(model)).count(wrapper) != 0;
  if (successful) {
    SqlUtils.notifyModelChanged(model,modelAdapter,BaseModel.Action.DELETE);
  }
  modelAdapter.updateAutoIncrement(model,0);
  return successful;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public synchronized boolean delete(@NonNull TModel model,@NonNull DatabaseWrapper wrapper){
  modelAdapter.deleteForeignKeys(model,wrapper);
  boolean successful=SQLite.delete(modelAdapter.getModelClass()).where(modelAdapter.getPrimaryConditionClause(model)).executeUpdateDelete(wrapper) != 0;
  if (successful) {
    SqlUtils.notifyModelChanged(model,modelAdapter,BaseModel.Action.DELETE);
  }
  modelAdapter.updateAutoIncrement(model,0);
  return successful;
}
Program: 26757
Project: 26757
Buggy source:
public void load(TModel model,DatabaseWrapper databaseWrapper){
  getSingleModelLoader().load(databaseWrapper,SQLite.select().from(getModelClass()).where(getPrimaryConditionClause(model)).getQuery());
}

Fixed version (ground truth):
public void load(TModel model,DatabaseWrapper databaseWrapper){
  getSingleModelLoader().load(databaseWrapper,SQLite.select().from(getModelClass()).where(getPrimaryConditionClause(model)).getQuery(),model);
}
Program: 26758
Project: 26758
Buggy source:
public void writeInsert(CodeBlock.Builder codeBuilder,boolean useWrapper){
  if (isSave()) {
    writeLoopWithMethod(codeBuilder,"String_Node_Str",useWrapper && extendsBaseModel);
  }
}

Fixed version (ground truth):
public void writeInsert(CodeBlock.Builder codeBuilder,boolean useWrapper){
  if (isSave()) {
    writeLoopWithMethod(codeBuilder,"String_Node_Str",useWrapper && extendsBaseModel || useWrapper && !extendsModel);
  }
}
Program: 26759
Project: 26759
Buggy source:
private void writeLoopWithMethod(CodeBlock.Builder codeBuilder,String methodName,boolean useWrapper){
  codeBuilder.beginControlFlow("String_Node_Str",getMethodName()).beginControlFlow("String_Node_Str",extendsBaseModel ? ClassNames.BASE_MODEL : ClassNames.MODEL,getMethodName()).addStatement("String_Node_Str",methodName,useWrapper ? ModelUtils.getWrapper() : "String_Node_Str").endControlFlow().endControlFlow();
}

Fixed version (ground truth):
private void writeLoopWithMethod(CodeBlock.Builder codeBuilder,String methodName,boolean useWrapper){
  codeBuilder.beginControlFlow("String_Node_Str",getMethodName());
  ClassName loopClass=null;
  if (extendsBaseModel) {
    loopClass=ClassNames.BASE_MODEL;
  }
 else {
    loopClass=ClassName.get(referencedType);
  }
  if (!extendsModel) {
    codeBuilder.addStatement("String_Node_Str",ParameterizedTypeName.get(ClassNames.MODEL_ADAPTER,referencedTableType),ClassNames.FLOW_MANAGER,referencedTableType);
    codeBuilder.addStatement("String_Node_Str",methodName,getMethodName(),useWrapper ? ("String_Node_Str" + ModelUtils.getWrapper()) : "String_Node_Str");
  }
 else {
    codeBuilder.beginControlFlow("String_Node_Str",loopClass,getMethodName());
    codeBuilder.addStatement("String_Node_Str",methodName,useWrapper ? ModelUtils.getWrapper() : "String_Node_Str");
    codeBuilder.endControlFlow();
  }
  codeBuilder.endControlFlow();
}
Program: 26760
Project: 26760
Buggy source:
public OneToManyDefinition(ExecutableElement typeElement,ProcessorManager processorManager){
  super(typeElement,processorManager);
  OneToMany oneToMany=typeElement.getAnnotation(OneToMany.class);
  methodName=typeElement.getSimpleName().toString();
  variableName=oneToMany.variableName();
  if (variableName == null || variableName.isEmpty()) {
    variableName=methodName.replace("String_Node_Str","String_Node_Str");
    variableName=variableName.substring(0,1).toLowerCase() + variableName.substring(1);
  }
  methods.addAll(Arrays.asList(oneToMany.methods()));
  if (oneToMany.isVariablePrivate()) {
    columnAccess=new PrivateColumnAccess(false);
  }
 else {
    columnAccess=new SimpleColumnAccess();
  }
  extendsBaseModel=false;
  TypeMirror returnType=typeElement.getReturnType();
  TypeName typeName=TypeName.get(returnType);
  if (typeName instanceof ParameterizedTypeName) {
    List<TypeName> typeArguments=((ParameterizedTypeName)typeName).typeArguments;
    if (typeArguments.size() == 1) {
      TypeName returnTypeName=typeArguments.get(0);
      extendsBaseModel=ProcessorUtils.isSubclass(manager.getProcessingEnvironment(),ClassNames.BASE_MODEL.toString(),manager.getElements().getTypeElement(returnTypeName.toString()));
    }
  }
}

Fixed version (ground truth):
public OneToManyDefinition(ExecutableElement typeElement,ProcessorManager processorManager){
  super(typeElement,processorManager);
  OneToMany oneToMany=typeElement.getAnnotation(OneToMany.class);
  methodName=typeElement.getSimpleName().toString();
  variableName=oneToMany.variableName();
  if (variableName == null || variableName.isEmpty()) {
    variableName=methodName.replace("String_Node_Str","String_Node_Str");
    variableName=variableName.substring(0,1).toLowerCase() + variableName.substring(1);
  }
  methods.addAll(Arrays.asList(oneToMany.methods()));
  if (oneToMany.isVariablePrivate()) {
    columnAccess=new PrivateColumnAccess(false);
  }
 else {
    columnAccess=new SimpleColumnAccess();
  }
  extendsBaseModel=false;
  TypeMirror returnType=typeElement.getReturnType();
  TypeName typeName=TypeName.get(returnType);
  if (typeName instanceof ParameterizedTypeName) {
    List<TypeName> typeArguments=((ParameterizedTypeName)typeName).typeArguments;
    if (typeArguments.size() == 1) {
      referencedTableType=typeArguments.get(0);
      referencedType=manager.getElements().getTypeElement(referencedTableType.toString());
      extendsBaseModel=ProcessorUtils.isSubclass(manager.getProcessingEnvironment(),ClassNames.BASE_MODEL.toString(),referencedType);
      extendsModel=ProcessorUtils.isSubclass(manager.getProcessingEnvironment(),ClassNames.MODEL.toString(),referencedType);
    }
  }
}
Program: 26761
Project: 26761
Buggy source:
@OneToMany(methods={OneToMany.Method.ALL}) public List<TestModel2> getOrders(){
  if (orders == null) {
    orders=new Select().from(TestModel2.class).where(TestModel2_Table.model_order.greaterThan(3)).queryList();
  }
  return orders;
}

Fixed version (ground truth):
@OneToMany(methods={OneToMany.Method.ALL}) public List<OneToManyModelNonModel> getOrders(){
  if (orders == null) {
    orders=new Select().from(OneToManyModelNonModel.class).queryList();
  }
  return orders;
}
Program: 26762
Project: 26762
Buggy source:
@Override public void save(){
  executeTransaction(new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<TModel>(){
    @Override public void processModel(    TModel model){
      model.save();
    }
  }
).build());
}

Fixed version (ground truth):
@Override public void save(){
  executeTransaction(new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<TModel>(){
    @Override public void processModel(    TModel model){
      model.save();
    }
  }
).add(model).build());
}
Program: 26763
Project: 26763
Buggy source:
@Override public void update(){
  executeTransaction(new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<TModel>(){
    @Override public void processModel(    TModel model){
      model.update();
    }
  }
).build());
}

Fixed version (ground truth):
@Override public void update(){
  executeTransaction(new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<TModel>(){
    @Override public void processModel(    TModel model){
      model.update();
    }
  }
).add(model).build());
}
Program: 26764
Project: 26764
Buggy source:
@Override public void insert(){
  executeTransaction(new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<TModel>(){
    @Override public void processModel(    TModel model){
      model.insert();
    }
  }
).build());
}

Fixed version (ground truth):
@Override public void insert(){
  executeTransaction(new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<TModel>(){
    @Override public void processModel(    TModel model){
      model.insert();
    }
  }
).add(model).build());
}
Program: 26765
Project: 26765
Buggy source:
@Override public void delete(){
  executeTransaction(new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<TModel>(){
    @Override public void processModel(    TModel model){
      model.delete();
    }
  }
).build());
}

Fixed version (ground truth):
@Override public void delete(){
  executeTransaction(new ProcessModelTransaction.Builder<>(new ProcessModelTransaction.ProcessModel<TModel>(){
    @Override public void processModel(    TModel model){
      model.delete();
    }
  }
).add(model).build());
}
Program: 26766
Project: 26766
Buggy source:
@Override public void appendConditionToQuery(QueryBuilder queryBuilder){
  if (useParenthesis && conditionsList.size() > 0) {
    queryBuilder.append("String_Node_Str");
  }
  for (  SQLCondition condition : conditionsList) {
    condition.appendConditionToQuery(queryBuilder);
    if (condition.hasSeparator()) {
      queryBuilder.appendSpaceSeparated(condition.separator());
    }
  }
  if (useParenthesis && conditionsList.size() > 0) {
    queryBuilder.append("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void appendConditionToQuery(QueryBuilder queryBuilder){
  int conditionListSize=conditionsList.size();
  if (useParenthesis && conditionListSize > 0) {
    queryBuilder.append("String_Node_Str");
  }
  for (int i=0; i < conditionListSize; i++) {
    SQLCondition condition=conditionsList.get(i);
    condition.appendConditionToQuery(queryBuilder);
    if (condition.hasSeparator() && i < conditionListSize - 1) {
      queryBuilder.appendSpaceSeparated(condition.separator());
    }
  }
  if (useParenthesis && conditionListSize > 0) {
    queryBuilder.append("String_Node_Str");
  }
}
Program: 26767
Project: 26767
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void run(){
  super.run();
  Looper.prepare();
  android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
  while (true) {
    final ArrayList<Model> tmpModels;
synchronized (models) {
      tmpModels=new ArrayList<>(models);
      models.clear();
    }
    if (tmpModels.size() > 0) {
      databaseDefinition.beginTransactionAsync(new ProcessModelTransaction.Builder(modelSaver).build()).success(successCallback).error(errorCallback).build().execute();
    }
    try {
      Thread.sleep(modelSaveCheckTime);
    }
 catch (    InterruptedException e) {
      FlowLog.log(FlowLog.Level.I,"String_Node_Str");
    }
    if (isQuitting) {
      return;
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void run(){
  super.run();
  Looper.prepare();
  android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_BACKGROUND);
  while (true) {
    final ArrayList<Model> tmpModels;
synchronized (models) {
      tmpModels=new ArrayList<>(models);
      models.clear();
    }
    if (tmpModels.size() > 0) {
      databaseDefinition.beginTransactionAsync(new ProcessModelTransaction.Builder(modelSaver).addAll(tmpModels).build()).success(successCallback).error(errorCallback).build().execute();
    }
    try {
      Thread.sleep(modelSaveCheckTime);
    }
 catch (    InterruptedException e) {
      FlowLog.log(FlowLog.Level.I,"String_Node_Str");
    }
    if (isQuitting) {
      return;
    }
  }
}
Program: 26768
Project: 26768
Buggy source:
@Test public void testConcurrentInsert() throws InterruptedException {
  Delete.table(TestModel1.class);
  ExecutorService executorService=Executors.newFixedThreadPool(3);
  for (int i=0; i < CONCURRENT_INSERT_COUNT; i++) {
    executorService.execute(new InsertRunnable());
  }
  executorService.shutdown();
  executorService.awaitTermination(CONCURRENT_INSERT_TIMEOUT,TimeUnit.MILLISECONDS);
  long modelCount=selectCountOf().from(TestModel1.class).count();
  List<TestModel1> models=select().from(TestModel1.class).queryList();
  for (  TestModel1 model : models) {
    System.out.println("String_Node_Str" + model.getName());
  }
  assertEquals(CONCURRENT_INSERT_COUNT,modelCount);
}

Fixed version (ground truth):
@Test public void testConcurrentInsert() throws InterruptedException {
  Delete.table(TestModel1.class);
  ExecutorService executorService=Executors.newFixedThreadPool(3);
  for (int i=0; i < CONCURRENT_INSERT_COUNT; i++) {
    executorService.execute(new InsertRunnable());
  }
  executorService.shutdown();
  executorService.awaitTermination(CONCURRENT_INSERT_TIMEOUT,TimeUnit.MILLISECONDS);
  long modelCount=selectCountOf().from(TestModel1.class).count();
  assertEquals(CONCURRENT_INSERT_COUNT,modelCount);
}
Program: 26769
Project: 26769
Buggy source:
public synchronized OpenHelper getHelper(){
  if (openHelper == null) {
    DatabaseConfig config=FlowManager.getConfig().databaseConfigMap().get(getAssociatedDatabaseClassFile());
    if (config == null || config.helperCreator() == null) {
      openHelper=new FlowSQLiteOpenHelper(this,helperListener);
    }
 else {
      openHelper=config.helperCreator().createHelper(this,helperListener);
    }
  }
  return openHelper;
}

Fixed version (ground truth):
public synchronized OpenHelper getHelper(){
  if (openHelper == null) {
    DatabaseConfig config=FlowManager.getConfig().databaseConfigMap().get(getAssociatedDatabaseClassFile());
    if (config == null || config.helperCreator() == null) {
      openHelper=new FlowSQLiteOpenHelper(this,helperListener);
    }
 else {
      openHelper=config.helperCreator().createHelper(this,helperListener);
    }
    openHelper.performRestoreFromBackup();
  }
  return openHelper;
}
Program: 26770
Project: 26770
Buggy source:
/** 
 * Checks a standard database helper for integrity using quick_check(1).
 * @param openHelper The helper to user to look up integrity.
 * @return true if it's integrity is OK.
 */
public static boolean isDatabaseIntegrityOk(OpenHelper openHelper){
  boolean integrityOk=true;
  DatabaseStatement prog=null;
  try {
    prog=openHelper.getDatabase().compileStatement("String_Node_Str");
    String rslt=prog.simpleQueryForString();
    if (!rslt.equalsIgnoreCase("String_Node_Str")) {
      FlowLog.log(FlowLog.Level.E,"String_Node_Str" + rslt);
      integrityOk=false;
    }
  }
  finally {
    if (prog != null) {
      prog.close();
    }
  }
  return integrityOk;
}

Fixed version (ground truth):
/** 
 * Checks a standard database helper for integrity using quick_check(1).
 * @param databaseName The name of the database to check. Will thrown an exception if it does not exist.
 * @return true if it's integrity is OK.
 */
public static boolean isDatabaseIntegrityOk(String databaseName){
  return getDatabase(databaseName).getHelper().isDatabaseIntegrityOk();
}
Program: 26771
Project: 26771
Buggy source:
public DatabaseHelperDelegate(DatabaseHelperListener databaseHelperListener,DatabaseDefinition databaseDefinition,@Nullable OpenHelper backupHelper){
  super(databaseDefinition);
  this.databaseHelperListener=databaseHelperListener;
  this.backupHelper=backupHelper;
  movePrepackagedDB(getDatabaseDefinition().getDatabaseFileName(),getDatabaseDefinition().getDatabaseFileName());
  if (databaseDefinition.backupEnabled()) {
    restoreDatabase(getTempDbFileName(),getDatabaseDefinition().getDatabaseFileName());
    if (backupHelper == null) {
      throw new IllegalStateException("String_Node_Str" + "String_Node_Str");
    }
    backupHelper.getDatabase();
  }
}

Fixed version (ground truth):
public DatabaseHelperDelegate(DatabaseHelperListener databaseHelperListener,DatabaseDefinition databaseDefinition,@Nullable OpenHelper backupHelper){
  super(databaseDefinition);
  this.databaseHelperListener=databaseHelperListener;
  this.backupHelper=backupHelper;
}
Program: 26772
Project: 26772
Buggy source:
/** 
 * Copies over the prepackaged DB into the main DB then deletes the existing DB to save storage space. If we have a backup that exists
 * @param databaseName    The name of the database to copy over
 * @param prepackagedName The name of the prepackaged db file
 */
public void movePrepackagedDB(String databaseName,String prepackagedName){
  final File dbPath=FlowManager.getContext().getDatabasePath(databaseName);
  if (dbPath.exists() && (!getDatabaseDefinition().areConsistencyChecksEnabled() || (getDatabaseDefinition().areConsistencyChecksEnabled() && isDatabaseIntegrityOk()))) {
    return;
  }
  dbPath.getParentFile().mkdirs();
  try {
    File existingDb=FlowManager.getContext().getDatabasePath(getTempDbFileName());
    InputStream inputStream;
    if (existingDb.exists() && (!getDatabaseDefinition().backupEnabled() || getDatabaseDefinition().backupEnabled() && FlowManager.isDatabaseIntegrityOk(backupHelper))) {
      inputStream=new FileInputStream(existingDb);
    }
 else {
      inputStream=FlowManager.getContext().getAssets().open(prepackagedName);
    }
    writeDB(dbPath,inputStream);
  }
 catch (  IOException e) {
    FlowLog.log(FlowLog.Level.W,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Copies over the prepackaged DB into the main DB then deletes the existing DB to save storage space. If we have a backup that exists
 * @param databaseName    The name of the database to copy over
 * @param prepackagedName The name of the prepackaged db file
 */
public void movePrepackagedDB(String databaseName,String prepackagedName,DatabaseWrapper databaseWrapper,DatabaseWrapper backupDatabaseWrapper){
  final File dbPath=FlowManager.getContext().getDatabasePath(databaseName);
  if (dbPath.exists() && (!getDatabaseDefinition().areConsistencyChecksEnabled() || (getDatabaseDefinition().areConsistencyChecksEnabled() && isDatabaseIntegrityOk(databaseWrapper)))) {
    return;
  }
  dbPath.getParentFile().mkdirs();
  try {
    File existingDb=FlowManager.getContext().getDatabasePath(getTempDbFileName());
    InputStream inputStream;
    if (existingDb.exists() && (!getDatabaseDefinition().backupEnabled() || getDatabaseDefinition().backupEnabled() && isDatabaseIntegrityOk(backupDatabaseWrapper))) {
      inputStream=new FileInputStream(existingDb);
    }
 else {
      inputStream=FlowManager.getContext().getAssets().open(prepackagedName);
    }
    writeDB(dbPath,inputStream);
  }
 catch (  IOException e) {
    FlowLog.log(FlowLog.Level.W,"String_Node_Str",e);
  }
}
Program: 26773
Project: 26773
Buggy source:
/** 
 * Pulled partially from code, it runs a "PRAGMA quick_check(1)" to see if the database is ok. This method will   {@link #restoreBackUp()} if they are enabled on the database if this check fails. Souse with caution and ensure that you backup the database often!
 * @return true if the database is ok, false if the consistency has been compromised.
 */
public boolean isDatabaseIntegrityOk(){
  boolean integrityOk=true;
  DatabaseStatement prog=null;
  try {
    prog=getWritableDatabase().compileStatement("String_Node_Str");
    String rslt=prog.simpleQueryForString();
    if (!rslt.equalsIgnoreCase("String_Node_Str")) {
      FlowLog.log(FlowLog.Level.E,"String_Node_Str" + getDatabaseDefinition().getDatabaseName() + "String_Node_Str"+ rslt);
      integrityOk=false;
      if (getDatabaseDefinition().backupEnabled()) {
        integrityOk=restoreBackUp();
      }
    }
  }
  finally {
    if (prog != null) {
      prog.close();
    }
  }
  return integrityOk;
}

Fixed version (ground truth):
/** 
 * Pulled partially from code, it runs a "PRAGMA quick_check(1)" to see if the database is ok. This method will   {@link #restoreBackUp()} if they are enabled on the database if this check fails. Souse with caution and ensure that you backup the database often!
 * @return true if the database is ok, false if the consistency has been compromised.
 */
public boolean isDatabaseIntegrityOk(DatabaseWrapper databaseWrapper){
  boolean integrityOk=true;
  DatabaseStatement prog=null;
  try {
    prog=databaseWrapper.compileStatement("String_Node_Str");
    String rslt=prog.simpleQueryForString();
    if (!rslt.equalsIgnoreCase("String_Node_Str")) {
      FlowLog.log(FlowLog.Level.E,"String_Node_Str" + getDatabaseDefinition().getDatabaseName() + "String_Node_Str"+ rslt);
      integrityOk=false;
      if (getDatabaseDefinition().backupEnabled()) {
        integrityOk=restoreBackUp();
      }
    }
  }
  finally {
    if (prog != null) {
      prog.close();
    }
  }
  return integrityOk;
}
Program: 26774
Project: 26774
Buggy source:
/** 
 * Will use the already existing app database if   {@link DatabaseDefinition#backupEnabled()} is true. If the existingis not there we will try to use the prepackaged database for that purpose.
 * @param databaseName    The name of the database to restore
 * @param prepackagedName The name of the prepackaged db file
 */
public void restoreDatabase(String databaseName,String prepackagedName){
  final File dbPath=FlowManager.getContext().getDatabasePath(databaseName);
  if (dbPath.exists()) {
    return;
  }
  dbPath.getParentFile().mkdirs();
  try {
    File existingDb=FlowManager.getContext().getDatabasePath(getDatabaseDefinition().getDatabaseFileName());
    InputStream inputStream;
    if (existingDb.exists() && (getDatabaseDefinition().backupEnabled() && FlowManager.isDatabaseIntegrityOk(backupHelper))) {
      inputStream=new FileInputStream(existingDb);
    }
 else {
      inputStream=FlowManager.getContext().getAssets().open(prepackagedName);
    }
    writeDB(dbPath,inputStream);
  }
 catch (  IOException e) {
    FlowLog.logError(e);
  }
}

Fixed version (ground truth):
/** 
 * Will use the already existing app database if   {@link DatabaseDefinition#backupEnabled()} is true. If the existingis not there we will try to use the prepackaged database for that purpose.
 * @param databaseName    The name of the database to restore
 * @param prepackagedName The name of the prepackaged db file
 */
public void restoreDatabase(String databaseName,String prepackagedName){
  final File dbPath=FlowManager.getContext().getDatabasePath(databaseName);
  if (dbPath.exists()) {
    return;
  }
  dbPath.getParentFile().mkdirs();
  try {
    File existingDb=FlowManager.getContext().getDatabasePath(getDatabaseDefinition().getDatabaseFileName());
    InputStream inputStream;
    if (existingDb.exists() && (getDatabaseDefinition().backupEnabled() && backupHelper != null && isDatabaseIntegrityOk(backupHelper.getDatabase()))) {
      inputStream=new FileInputStream(existingDb);
    }
 else {
      inputStream=FlowManager.getContext().getAssets().open(prepackagedName);
    }
    writeDB(dbPath,inputStream);
  }
 catch (  IOException e) {
    FlowLog.logError(e);
  }
}
Program: 26775
Project: 26775
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 {
    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");
}

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"));
    }
 else     if (columnAccess instanceof EnumColumnAccess) {
      columnAccessString=columnAccessString.substring(0,columnAccessString.lastIndexOf("String_Node_Str"));
    }
    codeBuilder.add(columnAccessString);
  }
  codeBuilder.add("String_Node_Str");
}
Program: 26776
Project: 26776
Buggy source:
@Override public Condition concatenate(ITypeConditional conditional){
  return concatenate((Object)conditional);
}

Fixed version (ground truth):
@Override public Condition concatenate(IConditional conditional){
  return concatenate((Object)conditional);
}
Program: 26777
Project: 26777
Buggy source:
Condition concatenate(ITypeConditional conditional);

Fixed version (ground truth):
Condition concatenate(IConditional conditional);
Program: 26779
Project: 26779
Buggy source:
public void addContentProviderDefinition(ContentProviderDefinition contentProviderDefinition){
  providerMap.put(contentProviderDefinition.elementTypeName,contentProviderDefinition);
}

Fixed version (ground truth):
public void addContentProviderDefinition(ContentProviderDefinition contentProviderDefinition){
  DatabaseHolderDefinition holderDefinition=getOrPutDatabase(contentProviderDefinition.databaseName);
  holderDefinition.providerMap.put(contentProviderDefinition.elementTypeName,contentProviderDefinition);
  providerMap.put(contentProviderDefinition.elementTypeName,contentProviderDefinition);
}
Program: 26780
Project: 26780
Buggy source:
/** 
 * @return The name used as part of the AS query.
 */
public String aliasName(){
  return shouldAddIdentifierToAliasName ? QueryBuilder.quoteIfNeeded(aliasName) : aliasName;
}

Fixed version (ground truth):
/** 
 * @return The name used as part of the AS query.
 */
public String aliasName(){
  return (StringUtils.isNotNullOrEmpty(aliasName) && shouldAddIdentifierToAliasName) ? QueryBuilder.quoteIfNeeded(aliasName) : aliasName;
}
Program: 26781
Project: 26781
Buggy source:
/** 
 * @return The real column name.
 */
public String name(){
  return shouldAddIdentifierToQuery ? QueryBuilder.quoteIfNeeded(name) : name;
}

Fixed version (ground truth):
/** 
 * @return The real column name.
 */
public String name(){
  return (StringUtils.isNotNullOrEmpty(name) && shouldAddIdentifierToQuery) ? QueryBuilder.quoteIfNeeded(name) : name;
}
Program: 26782
Project: 26782
Buggy source:
@Override public TypeSpec getTypeSpec(){
  TypeSpec.Builder typeBuilder=TypeSpec.classBuilder(this.className).addModifiers(Modifier.PUBLIC,Modifier.FINAL).superclass(ClassNames.DATABASE_HOLDER);
  MethodSpec.Builder constructor=MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC);
  for (  TypeConverterDefinition typeConverterDefinition : processorManager.getTypeConverters()) {
    constructor.addStatement("String_Node_Str",DatabaseHandler.TYPE_CONVERTER_MAP_FIELD_NAME,typeConverterDefinition.getModelTypeName(),typeConverterDefinition.getClassName());
  }
  for (  DatabaseHolderDefinition databaseDefinition : processorManager.getDatabaseDefinitionMap()) {
    constructor.addStatement("String_Node_Str",databaseDefinition.getDatabaseDefinition().outputClassName);
  }
  typeBuilder.addMethod(constructor.build());
  return typeBuilder.build();
}

Fixed version (ground truth):
@Override public TypeSpec getTypeSpec(){
  TypeSpec.Builder typeBuilder=TypeSpec.classBuilder(this.className).addModifiers(Modifier.PUBLIC,Modifier.FINAL).superclass(ClassNames.DATABASE_HOLDER);
  MethodSpec.Builder constructor=MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC);
  for (  TypeConverterDefinition typeConverterDefinition : processorManager.getTypeConverters()) {
    constructor.addStatement("String_Node_Str",DatabaseHandler.TYPE_CONVERTER_MAP_FIELD_NAME,typeConverterDefinition.getModelTypeName(),typeConverterDefinition.getClassName());
  }
  for (  DatabaseHolderDefinition databaseDefinition : processorManager.getDatabaseDefinitionMap()) {
    if (databaseDefinition.getDatabaseDefinition() != null) {
      constructor.addStatement("String_Node_Str",databaseDefinition.getDatabaseDefinition().outputClassName);
    }
  }
  typeBuilder.addMethod(constructor.build());
  return typeBuilder.build();
}