nus-yam/ex-repair huggingface dataset:
Program: 52632
Project: 52632
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  mAppContext.getContentResolver().delete(taskUri,null,null);
  Snackbar.make(mExpandableListView,getString(R.string.toast_task_deleted,taskTitle),Snackbar.LENGTH_SHORT).show();
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int which){
  mAppContext.getContentResolver().delete(taskUri,null,null);
  Snackbar.make(mExpandableListView,getString(R.string.toast_task_deleted,taskTitle),Snackbar.LENGTH_SHORT).show();
  mCallbacks.onItemSelected(null,false,-1);
}
Program: 52633
Project: 52633
Buggy source:
/** 
 * Remove the task with the given   {@link Uri} and title, asking for confirmation first.
 * @param taskUri The  {@link Uri} of the atsk to remove.
 * @param taskTitle the title of the task to remove.
 * @return
 */
private void removeTask(final Uri taskUri,final String taskTitle){
  new AlertDialog.Builder(getActivity()).setTitle(R.string.confirm_delete_title).setCancelable(true).setNegativeButton(android.R.string.cancel,new OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
).setPositiveButton(android.R.string.ok,new OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      mAppContext.getContentResolver().delete(taskUri,null,null);
      Snackbar.make(mExpandableListView,getString(R.string.toast_task_deleted,taskTitle),Snackbar.LENGTH_SHORT).show();
    }
  }
).setMessage(getString(R.string.confirm_delete_message_with_title,taskTitle)).create().show();
}

Fixed version (ground truth):
/** 
 * Remove the task with the given   {@link Uri} and title, asking for confirmation first.
 * @param taskUri The  {@link Uri} of the atsk to remove.
 * @param taskTitle the title of the task to remove.
 * @return
 */
private void removeTask(final Uri taskUri,final String taskTitle){
  new AlertDialog.Builder(getActivity()).setTitle(R.string.confirm_delete_title).setCancelable(true).setNegativeButton(android.R.string.cancel,new OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
    }
  }
).setPositiveButton(android.R.string.ok,new OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      mAppContext.getContentResolver().delete(taskUri,null,null);
      Snackbar.make(mExpandableListView,getString(R.string.toast_task_deleted,taskTitle),Snackbar.LENGTH_SHORT).show();
      mCallbacks.onItemSelected(null,false,-1);
    }
  }
).setMessage(getString(R.string.confirm_delete_message_with_title,taskTitle)).create().show();
}
Program: 52634
Project: 52634
Buggy source:
public void reload(){
  mItems=null;
  mExecutor.execute(mReloadTasks);
}

Fixed version (ground truth):
public void reload(){
  mExecutor.execute(mReloadTasks);
}
Program: 52635
Project: 52635
Buggy source:
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) private void notifyUser(boolean close){
  if (VERSION.SDK_INT >= 14) {
    mContent.animate().alpha(0).setDuration(250).start();
    mConfirmation.setAlpha(0);
    mConfirmation.setVisibility(View.VISIBLE);
    mConfirmation.animate().alpha(1).setDuration(250).start();
  }
 else {
    mContent.setVisibility(View.INVISIBLE);
    mConfirmation.setVisibility(View.VISIBLE);
  }
  if (close) {
    mContent.postDelayed(mDismiss,1000);
  }
 else {
    int duration=COMPLETION_DELAY_BASE + COMPLETION_DELAY_MAX / ++mSaveCounter;
    mContent.postDelayed(mReset,duration);
  }
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) private void notifyUser(boolean close){
  if (VERSION.SDK_INT >= 14) {
    mContent.animate().alpha(0).setDuration(250).start();
    mConfirmation.setAlpha(0);
    mConfirmation.setVisibility(View.VISIBLE);
    mConfirmation.animate().alpha(1).setDuration(250).start();
  }
 else {
    mContent.setVisibility(View.INVISIBLE);
    mConfirmation.setVisibility(View.VISIBLE);
  }
  if (close) {
    delayedDismiss();
  }
 else {
    int duration=COMPLETION_DELAY_BASE + COMPLETION_DELAY_MAX / ++mSaveCounter;
    mContent.postDelayed(mReset,duration);
  }
}
Program: 52637
Project: 52637
Buggy source:
@Override public void onPageSelected(int position){
  int newPageId=mPagerAdapter.getPageId(position);
  if (newPageId == R.id.task_group_search) {
    int oldPageId=mCurrentPageId;
    mCurrentPageId=newPageId;
    MenuItemCompat.expandActionView(mSearchItem);
    mPreviousPagePosition=mPagerAdapter.getPagePosition(oldPageId);
  }
 else   if (mCurrentPageId == R.id.task_group_search) {
    mSearchHistoryHelper.commitSearch();
    mHandler.post(mSearchUpdater);
    mCurrentPageId=newPageId;
    hideSearchActionView();
  }
  mCurrentPageId=newPageId;
  updateTitle(mCurrentPageId);
}

Fixed version (ground truth):
@Override public void onPageSelected(int position){
  int newPageId=mPagerAdapter.getPageId(position);
  if (newPageId == R.id.task_group_search) {
    int oldPageId=mCurrentPageId;
    mCurrentPageId=newPageId;
    mPreviousPagePosition=mPagerAdapter.getPagePosition(oldPageId);
  }
 else   if (mCurrentPageId == R.id.task_group_search) {
    mSearchHistoryHelper.commitSearch();
    mHandler.post(mSearchUpdater);
    mCurrentPageId=newPageId;
    hideSearchActionView();
  }
  mCurrentPageId=newPageId;
  updateTitle(mCurrentPageId);
}
Program: 52638
Project: 52638
Buggy source:
@Override public void onPageScrollStateChanged(int position){
}

Fixed version (ground truth):
@Override public void onPageScrollStateChanged(int state){
  if (state == ViewPager.SCROLL_STATE_IDLE && mCurrentPageId == R.id.task_group_search) {
    mHandler.post(new Runnable(){
      @Override public void run(){
        MenuItemCompat.expandActionView(mSearchItem);
      }
    }
);
  }
}
Program: 52639
Project: 52639
Buggy source:
@Override public boolean onQueryTextChange(String query){
  mHandler.removeCallbacks(mSearchUpdater);
  if (query.length() > 0) {
    mSearchHistoryHelper.updateSearch(query);
    mHandler.postDelayed(mSearchUpdater,SEARCH_UPDATE_DELAY);
  }
 else {
    mSearchHistoryHelper.removeCurrentSearch();
    mHandler.post(mSearchUpdater);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onQueryTextChange(String query){
  if (mCurrentPageId != R.id.task_group_search) {
    return true;
  }
  mHandler.removeCallbacks(mSearchUpdater);
  if (query.length() > 0) {
    mSearchHistoryHelper.updateSearch(query);
    mHandler.postDelayed(mSearchUpdater,SEARCH_UPDATE_DELAY);
  }
 else {
    mSearchHistoryHelper.removeCurrentSearch();
    mHandler.post(mSearchUpdater);
  }
  return true;
}
Program: 52641
Project: 52641
Buggy source:
@Override public RemoteViews getViewAt(int position){
  if (items == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (items[position] == null) {
    throw new NullPointerException("String_Node_Str" + items.length + "String_Node_Str"+ position);
  }
  if (items[position].getTaskTitle() == null) {
    throw new NullPointerException("String_Node_Str" + position + "String_Node_Str");
  }
  RemoteViews row=new RemoteViews(context.getPackageName(),R.layout.task_list_widget_item);
  row.setTextViewText(android.R.id.title,items[position].getTaskTitle());
  row.setInt(R.id.task_list_color,"String_Node_Str",items[position].getTaskColor());
  Time dueDate=items[position].getDueDate();
  if (dueDate != null) {
    if (mNow == null) {
      mNow=new Time();
    }
    mNow.clear(TimeZone.getDefault().getID());
    mNow.setToNow();
    row.setTextViewText(android.R.id.text1,mDueDateFormatter.format(dueDate));
    if (dueDate.before(mNow) & !items[position].getIsClosed()) {
      row.setTextColor(android.R.id.text1,mResources.getColor(android.R.color.holo_red_light));
    }
 else {
      row.setTextColor(android.R.id.text1,mResources.getColor(R.color.lighter_gray));
    }
  }
 else {
    row.setTextViewText(android.R.id.text1,null);
  }
  Uri taskUri=ContentUris.withAppendedId(Tasks.CONTENT_URI,items[position].getTaskId());
  Intent i=new Intent();
  i.setData(taskUri);
  row.setOnClickFillInIntent(android.R.id.title,i);
  return (row);
}

Fixed version (ground truth):
@Override public RemoteViews getViewAt(int position){
  if (position < 0 || position > getCount()) {
    return null;
  }
  RemoteViews row=new RemoteViews(context.getPackageName(),R.layout.task_list_widget_item);
  row.setTextViewText(android.R.id.title,items[position].getTaskTitle());
  row.setInt(R.id.task_list_color,"String_Node_Str",items[position].getTaskColor());
  Time dueDate=items[position].getDueDate();
  if (dueDate != null) {
    if (mNow == null) {
      mNow=new Time();
    }
    mNow.clear(TimeZone.getDefault().getID());
    mNow.setToNow();
    row.setTextViewText(android.R.id.text1,mDueDateFormatter.format(dueDate));
    if (dueDate.before(mNow) & !items[position].getIsClosed()) {
      row.setTextColor(android.R.id.text1,mResources.getColor(android.R.color.holo_red_light));
    }
 else {
      row.setTextColor(android.R.id.text1,mResources.getColor(R.color.lighter_gray));
    }
  }
 else {
    row.setTextViewText(android.R.id.text1,null);
  }
  Uri taskUri=ContentUris.withAppendedId(Tasks.CONTENT_URI,items[position].getTaskId());
  Intent i=new Intent();
  i.setData(taskUri);
  row.setOnClickFillInIntent(android.R.id.title,i);
  return (row);
}
Program: 52642
Project: 52642
Buggy source:
/** 
 * Persist the current task (if anything has been edited) and close the editor.
 */
public void saveAndExit(){
  Activity activity=getActivity();
  int resultCode=Activity.RESULT_CANCELED;
  Intent result=null;
  int toastId=-1;
  if (mValues.isInsert() || mValues.isUpdate()) {
    if (!TextUtils.isEmpty(TaskFieldAdapters.TITLE.get(mValues)) || mValues.isUpdate()) {
      if (mValues.updatesAnyKey(RECURRENCE_VALUES)) {
        mValues.ensureUpdates(RECURRENCE_VALUES);
      }
      mTaskUri=mValues.persist(activity);
      result=new Intent();
      result.setData(mTaskUri);
      resultCode=Activity.RESULT_OK;
      toastId=R.string.activity_edit_task_task_saved;
    }
 else {
      toastId=R.string.activity_edit_task_empty_task_not_saved;
    }
  }
 else {
    Log.i(TAG,"String_Node_Str");
  }
  if (toastId != -1) {
    Toast.makeText(activity,toastId,Toast.LENGTH_SHORT).show();
  }
  if (result != null) {
    activity.setResult(resultCode,result);
  }
 else {
    activity.setResult(resultCode);
  }
  if (!mAppForEdit) {
    SharedPreferences prefs=getActivity().getPreferences(Activity.MODE_PRIVATE);
    Editor editor=prefs.edit();
    editor.putLong(PREFERENCE_LAST_LIST,mListSpinner.getSelectedItemId());
    editor.commit();
  }
  activity.finish();
}

Fixed version (ground truth):
/** 
 * Persist the current task (if anything has been edited) and close the editor.
 */
public void saveAndExit(){
  Activity activity=getActivity();
  int resultCode=Activity.RESULT_CANCELED;
  Intent result=null;
  int toastId=-1;
  if (mValues.isInsert() || mValues.isUpdate()) {
    if (!TextUtils.isEmpty(TaskFieldAdapters.TITLE.get(mValues)) || mValues.isUpdate()) {
      if (mValues.updatesAnyKey(RECURRENCE_VALUES)) {
        mValues.ensureUpdates(RECURRENCE_VALUES);
      }
      mTaskUri=mValues.persist(activity);
      result=new Intent();
      result.setData(mTaskUri);
      resultCode=Activity.RESULT_OK;
      toastId=R.string.activity_edit_task_task_saved;
    }
 else {
      toastId=R.string.activity_edit_task_empty_task_not_saved;
    }
  }
 else {
    Log.i(TAG,"String_Node_Str");
  }
  if (toastId != -1) {
    Toast.makeText(activity,toastId,Toast.LENGTH_SHORT).show();
  }
  if (result != null) {
    activity.setResult(resultCode,result);
  }
 else {
    activity.setResult(resultCode);
  }
  if (!mAppForEdit) {
    SharedPreferences prefs=getActivity().getPreferences(Activity.MODE_PRIVATE);
    Editor editor=prefs.edit();
    editor.putLong(PREFERENCE_LAST_LIST,mListSpinner.getSelectedItemId());
    editor.commit();
  }
  WidgetUtils.broadcastWidgetUpdate(mAppContext);
  activity.finish();
}
Program: 52643
Project: 52643
Buggy source:
@Override public boolean onFling(ListView v,int pos){
  long packedPos=mExpandableListView.getExpandableListPosition(pos);
  if (ExpandableListView.getPackedPositionType(packedPos) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
    ExpandableListAdapter listAdapter=mExpandableListView.getExpandableListAdapter();
    Cursor cursor=(Cursor)listAdapter.getChild(ExpandableListView.getPackedPositionGroup(packedPos),ExpandableListView.getPackedPositionChild(packedPos));
    if (cursor != null) {
      Long taskId=cursor.getLong(cursor.getColumnIndex(Instances.TASK_ID));
      if (taskId != null) {
        boolean closed=cursor.getLong(cursor.getColumnIndex(Instances.IS_CLOSED)) > 0;
        String title=cursor.getString(cursor.getColumnIndex(Instances.TITLE));
        Uri taskUri=ContentUris.withAppendedId(Tasks.CONTENT_URI,taskId);
        if (closed) {
          removeTask(taskUri,title);
          return false;
        }
 else {
          return completeTask(taskUri,title);
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onFling(ListView v,int pos){
  long packedPos=mExpandableListView.getExpandableListPosition(pos);
  if (ExpandableListView.getPackedPositionType(packedPos) == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
    ExpandableListAdapter listAdapter=mExpandableListView.getExpandableListAdapter();
    Cursor cursor=(Cursor)listAdapter.getChild(ExpandableListView.getPackedPositionGroup(packedPos),ExpandableListView.getPackedPositionChild(packedPos));
    if (cursor != null) {
      Long taskId=cursor.getLong(cursor.getColumnIndex(Instances.TASK_ID));
      if (taskId != null) {
        boolean closed=cursor.getLong(cursor.getColumnIndex(Instances.IS_CLOSED)) > 0;
        String title=cursor.getString(cursor.getColumnIndex(Instances.TITLE));
        Uri taskUri=ContentUris.withAppendedId(Tasks.CONTENT_URI,taskId);
        if (closed) {
          removeTask(taskUri,title);
          WidgetUtils.broadcastWidgetUpdate(mAppContext);
          return false;
        }
 else {
          boolean result=completeTask(taskUri,title);
          if (result) {
            WidgetUtils.broadcastWidgetUpdate(mAppContext);
          }
          return result;
        }
      }
    }
  }
  return false;
}
Program: 52646
Project: 52646
Buggy source:
/** 
 * Create a new   {@link FlingDetector} for the given {@link ListView}.
 * @param listview The  {@link ListView}.
 */
public FlingDetector(ListView listview){
  listview.setOnTouchListener(this);
  listview.setOnScrollListener(this);
  mListView=listview;
  ViewConfiguration vc=ViewConfiguration.get(listview.getContext());
  mTouchSlop=vc.getScaledTouchSlop();
  mMinimumFlingVelocity=vc.getScaledMinimumFlingVelocity() * 24;
  if (android.os.Build.VERSION.SDK_INT == 8) {
    mMaximumFlingVelocity=vc.getScaledMaximumFlingVelocity() * 2;
  }
 else {
    mMaximumFlingVelocity=vc.getScaledMaximumFlingVelocity();
  }
}

Fixed version (ground truth):
/** 
 * Create a new   {@link FlingDetector} for the given {@link ListView}.
 * @param listview The  {@link ListView}.
 */
public FlingDetector(ListView listview){
  listview.setOnTouchListener(this);
  listview.setOnScrollListener(this);
  mListView=listview;
  ViewConfiguration vc=ViewConfiguration.get(listview.getContext());
  mTouchSlop=vc.getScaledTouchSlop();
  mMinimumFlingVelocity=vc.getScaledMinimumFlingVelocity() * 16;
  if (android.os.Build.VERSION.SDK_INT == 8) {
    mMaximumFlingVelocity=vc.getScaledMaximumFlingVelocity() * 2;
  }
 else {
    mMaximumFlingVelocity=vc.getScaledMaximumFlingVelocity();
  }
}
Program: 52648
Project: 52648
Buggy source:
@Override public RemoteViews getViewAt(int position){
  RemoteViews row=new RemoteViews(context.getPackageName(),R.layout.task_list_widget_item);
  row.setTextViewText(android.R.id.title,items[position].getTaskTitle());
  row.setInt(R.id.task_list_color,"String_Node_Str",items[position].getTaskColor());
  Time dueDate=items[position].getDueDate();
  if (dueDate != null) {
    if (mNow == null) {
      mNow=new Time();
    }
    mNow.clear(TimeZone.getDefault().getID());
    mNow.setToNow();
    row.setTextViewText(android.R.id.text1,mDueDateFormatter.format(dueDate));
    if (dueDate.before(mNow) & !items[position].getIsClosed()) {
      row.setTextColor(android.R.id.text1,mResources.getColor(android.R.color.holo_red_light));
    }
 else {
      row.setTextColor(android.R.id.text1,mResources.getColor(R.color.lighter_gray));
    }
  }
  Uri taskUri=ContentUris.withAppendedId(Tasks.CONTENT_URI,items[position].getTaskId());
  Intent i=new Intent();
  i.setData(taskUri);
  row.setOnClickFillInIntent(android.R.id.title,i);
  return (row);
}

Fixed version (ground truth):
@Override public RemoteViews getViewAt(int position){
  RemoteViews row=new RemoteViews(context.getPackageName(),R.layout.task_list_widget_item);
  row.setTextViewText(android.R.id.title,items[position].getTaskTitle());
  row.setInt(R.id.task_list_color,"String_Node_Str",items[position].getTaskColor());
  Time dueDate=items[position].getDueDate();
  if (dueDate != null) {
    if (mNow == null) {
      mNow=new Time();
    }
    mNow.clear(TimeZone.getDefault().getID());
    mNow.setToNow();
    row.setTextViewText(android.R.id.text1,mDueDateFormatter.format(dueDate));
    if (dueDate.before(mNow) & !items[position].getIsClosed()) {
      row.setTextColor(android.R.id.text1,mResources.getColor(android.R.color.holo_red_light));
    }
 else {
      row.setTextColor(android.R.id.text1,mResources.getColor(R.color.lighter_gray));
    }
  }
 else {
    row.setTextViewText(android.R.id.text1,null);
  }
  Uri taskUri=ContentUris.withAppendedId(Tasks.CONTENT_URI,items[position].getTaskId());
  Intent i=new Intent();
  i.setData(taskUri);
  row.setOnClickFillInIntent(android.R.id.title,i);
  return (row);
}
Program: 52649
Project: 52649
Buggy source:
private void initNgrams(){
  for (int i=0; i < size_; i++) {
    String word=BOW + words_.get(i).word + EOW;
    if (args_.wordNgrams > 1 && !words_.get(i).word.equals(EOS)) {
      words_.get(i).subwords=computeSubWords(word,i);
    }
  }
}

Fixed version (ground truth):
private void initNgrams(){
  for (int i=0; i < size_; i++) {
    String word=BOW + words_.get(i).word + EOW;
    if (!words_.get(i).word.equals(EOS)) {
      words_.get(i).subwords=computeSubWords(word,i);
    }
  }
}
Program: 52650
Project: 52650
Buggy source:
private void initTableNegatives(long[] counts){
  IntVector vec=new IntVector(counts.length * 10);
  float z=0.0f;
  for (  long count : counts) {
    z+=(float)Math.pow(count,0.5);
  }
  for (int i=0; i < counts.length; i++) {
    float c=(float)Math.pow(counts[i],0.5);
    for (int j=0; j < c * NEGATIVE_TABLE_SIZE / z; j++) {
      vec.add(i);
    }
  }
  vec.shuffle(rng);
  negatives=vec.copyOf();
}

Fixed version (ground truth):
private void initTableNegatives(int[] counts){
  IntVector vec=new IntVector(counts.length * 10);
  float z=0.0f;
  for (  int count : counts) {
    z+=(float)Math.pow(count,0.5);
  }
  for (int i=0; i < counts.length; i++) {
    float c=(float)Math.pow(counts[i],0.5);
    for (int j=0; j < c * NEGATIVE_TABLE_SIZE / z; j++) {
      vec.add(i);
    }
  }
  vec.shuffle(rng);
  negatives=vec.copyOf();
}
Program: 52651
Project: 52651
Buggy source:
void setTargetCounts(long[] counts){
  assert(counts.length == osz_);
  if (args_.loss == Args.loss_name.ns) {
    initTableNegatives(counts);
  }
  if (args_.loss == Args.loss_name.hs) {
    buildTree(counts);
  }
}

Fixed version (ground truth):
void setTargetCounts(int[] counts){
  assert(counts.length == osz_);
  if (args_.loss == Args.loss_name.ns) {
    initTableNegatives(counts);
  }
  if (args_.loss == Args.loss_name.hs) {
    buildTree(counts);
  }
}
Program: 52652
Project: 52652
Buggy source:
/** 
 * This is used for hierarchical softmax calculation.
 */
private void buildTree(long[] counts){
  int nodeCount=2 * osz_ - 1;
  tree=new Node[nodeCount];
  for (int i=0; i < nodeCount; i++) {
    tree[i]=new Node();
    tree[i].parent=-1;
    tree[i].left=-1;
    tree[i].right=-1;
    tree[i].count=(long)1e15;
    tree[i].binary=false;
  }
  for (int i=0; i < osz_; i++) {
    tree[i].count=counts[i];
  }
  int leaf=osz_ - 1;
  int node=osz_;
  for (int i=osz_; i < nodeCount; i++) {
    int[] mini=new int[2];
    for (int j=0; j < 2; j++) {
      if (leaf >= 0 && tree[leaf].count < tree[node].count) {
        mini[j]=leaf--;
      }
 else {
        mini[j]=node++;
      }
    }
    tree[i].left=mini[0];
    tree[i].right=mini[1];
    tree[i].count=tree[mini[0]].count + tree[mini[1]].count;
    tree[mini[0]].parent=i;
    tree[mini[1]].parent=i;
    tree[mini[1]].binary=true;
  }
  for (int i=0; i < osz_; i++) {
    IntVector path=new IntVector();
    IntVector code=new IntVector();
    int j=i;
    while (tree[j].parent != -1) {
      path.add(tree[j].parent - osz_);
      code.add(tree[j].binary ? 1 : 0);
      j=tree[j].parent;
    }
    paths.add(path);
    codes.add(code);
  }
}

Fixed version (ground truth):
/** 
 * This is used for hierarchical softmax calculation.
 */
private void buildTree(int[] counts){
  int nodeCount=2 * osz_ - 1;
  tree=new Node[nodeCount];
  for (int i=0; i < nodeCount; i++) {
    tree[i]=new Node();
    tree[i].parent=-1;
    tree[i].left=-1;
    tree[i].right=-1;
    tree[i].count=(long)1e15;
    tree[i].binary=false;
  }
  for (int i=0; i < osz_; i++) {
    tree[i].count=counts[i];
  }
  int leaf=osz_ - 1;
  int node=osz_;
  for (int i=osz_; i < nodeCount; i++) {
    int[] mini=new int[2];
    for (int j=0; j < 2; j++) {
      if (leaf >= 0 && tree[leaf].count < tree[node].count) {
        mini[j]=leaf--;
      }
 else {
        mini[j]=node++;
      }
    }
    tree[i].left=mini[0];
    tree[i].right=mini[1];
    tree[i].count=tree[mini[0]].count + tree[mini[1]].count;
    tree[mini[0]].parent=i;
    tree[mini[1]].parent=i;
    tree[mini[1]].binary=true;
  }
  for (int i=0; i < osz_; i++) {
    IntVector path=new IntVector();
    IntVector code=new IntVector();
    int j=i;
    while (tree[j].parent != -1) {
      path.add(tree[j].parent - osz_);
      code.add(tree[j].binary ? 1 : 0);
      j=tree[j].parent;
    }
    paths.add(path);
    codes.add(code);
  }
}
Program: 52653
Project: 52653
Buggy source:
@Override public void run() throws IOException {
  Log.info("String_Node_Str",input);
  WordVectorsTrainer trainer=WordVectorsTrainer.builder().epochCount(epochCount).learningRate(learningRate).modelType(modelType).minWordCount(minWordCount).threadCount(threadCount).wordNgramOrder(wordNGrams).dimension(dimension).contextWindowSize(contextWindowSize).build();
  trainer.getEventBus().register(this);
  Log.info("String_Node_Str");
  FastText fastText=trainer.train(input);
  Log.info("String_Node_Str",output);
  fastText.saveVectors(output);
}

Fixed version (ground truth):
@Override public void run() throws IOException {
  Log.info("String_Node_Str",input);
  WordVectorsTrainer trainer=WordVectorsTrainer.builder().epochCount(epochCount).learningRate(learningRate).modelType(modelType).minWordCount(minWordCount).threadCount(threadCount).wordNgramOrder(wordNGrams).dimension(dimension).contextWindowSize(contextWindowSize).build();
  Log.info("String_Node_Str");
  trainer.getEventBus().register(this);
  FastText fastText=trainer.train(input);
  if (pb != null) {
    pb.close();
  }
  Log.info("String_Node_Str",output);
  fastText.saveVectors(output);
}
Program: 52654
Project: 52654
Buggy source:
@Subscribe public void trainingProgress(FastTextTrainer.Progress progress){
  Log.info("String_Node_Str",progress.percentProgress,progress.wordsPerSecond,progress.learningRate,progress.loss,progress.eta);
}

Fixed version (ground truth):
@Subscribe public void trainingProgress(FastTextTrainer.Progress progress){
synchronized (this) {
    if (pb == null) {
      System.setProperty("String_Node_Str","String_Node_Str");
      pb=new ProgressBar("String_Node_Str",progress.total,ProgressBarStyle.ASCII);
    }
  }
  pb.stepTo(progress.current);
  pb.setExtraMessage(String.format("String_Node_Str",progress.learningRate));
}
Program: 52655
Project: 52655
Buggy source:
private void printInfo(float progress,float loss){
  float t=stopwatch.elapsed(TimeUnit.MILLISECONDS) / 1000f;
  float wst=(float)tokenCount.get() / t;
  float lr=(float)(args_.lr * (1.0f - progress));
  int eta=(int)(t / progress * (1 - progress) / args_.thread);
  int etah=eta / 3600;
  int etam=(eta - etah * 3600) / 60;
  Progress p=new Progress(100 * progress,wst,lr,loss,String.format("String_Node_Str",etah,etam));
  eventBus.post(p);
}

Fixed version (ground truth):
private void printInfo(float progress,float loss){
  float t=stopwatch.elapsed(TimeUnit.MILLISECONDS) / 1000f;
  float wst=(float)tokenCount.get() / t;
  float lr=(float)(args_.lr * (1.0f - progress));
  int eta=(int)(t / progress * (1 - progress) / args_.thread);
  int etah=eta / 3600;
  int etam=(eta - etah * 3600) / 60;
  Progress p=new Progress(100 * progress,wst,lr,loss,String.format("String_Node_Str",etah,etam));
  p.total=args_.epoch * dictionary.ntokens();
  p.current=tokenCount.get();
  eventBus.post(p);
}
Program: 52657
Project: 52657
Buggy source:
public FastText train(Path corpus){
  Args.model_name m=builder.type == ModelType.SKIP_GRAM ? model_name.skipGram : model_name.cbow;
  Args args=Args.forWordVectors(m);
  args.dim=builder.dimension;
  args.wordNgrams=builder.wordNgramOrder;
  args.thread=builder.threadCount;
  args.epoch=builder.epochCount;
  args.lr=builder.learningRate;
  args.ws=builder.contextWindowSize;
  SubWordHashProvider p=builder.subWordHashProvider;
  args.subWordHashProvider=p;
  args.minn=p.getMinN();
  args.maxn=p.getMaxN();
  args.minCount=builder.minWordCount;
  FastTextTrainer trainer=new FastTextTrainer();
  trainer.getEventBus().register(this);
  try {
    return trainer.train(corpus,args);
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public FastText train(Path corpus){
  Args.model_name m=builder.type == ModelType.SKIP_GRAM ? model_name.skipGram : model_name.cbow;
  Args args=Args.forWordVectors(m);
  args.dim=builder.dimension;
  args.wordNgrams=builder.wordNgramOrder;
  args.thread=builder.threadCount;
  args.epoch=builder.epochCount;
  args.lr=builder.learningRate;
  args.ws=builder.contextWindowSize;
  SubWordHashProvider p=builder.subWordHashProvider;
  args.subWordHashProvider=p;
  args.minn=p.getMinN();
  args.maxn=p.getMaxN();
  args.minCount=builder.minWordCount;
  FastTextTrainer trainer=new FastTextTrainer(args);
  trainer.getEventBus().register(this);
  try {
    return trainer.train(corpus);
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}
Program: 52658
Project: 52658
Buggy source:
public void generateVectorModel(Path input,Path modelFile) throws Exception {
  Args argz=Args.forWordVectors(Args.model_name.skipGram);
  argz.thread=16;
  argz.epoch=10;
  argz.dim=250;
  argz.bucket=10;
  argz.minCount=10;
  argz.minn=0;
  argz.maxn=0;
  argz.subWordHashProvider=new EmbeddingHashProviders.EmptySubwordHashProvider();
  FastText fastText=new FastTextTrainer().train(input,argz);
  Log.info("String_Node_Str",modelFile);
  fastText.saveModel(modelFile);
}

Fixed version (ground truth):
public void generateVectorModel(Path input,Path modelFile) throws Exception {
  Args argz=Args.forWordVectors(Args.model_name.skipGram);
  argz.thread=16;
  argz.epoch=10;
  argz.dim=250;
  argz.bucket=10;
  argz.minCount=10;
  argz.minn=0;
  argz.maxn=0;
  argz.subWordHashProvider=new EmbeddingHashProviders.EmptySubwordHashProvider();
  FastText fastText=new FastTextTrainer(argz).train(input);
  Log.info("String_Node_Str",modelFile);
  fastText.saveModel(modelFile);
}
Program: 52659
Project: 52659
Buggy source:
public TrainerBuilder skipSpaceFrequencyonCount(int count){
  this.skipSpaceFrequency=skipSpaceFrequency;
  return this;
}

Fixed version (ground truth):
public TrainerBuilder skipSpaceFrequencyonCount(int count){
  this.skipSpaceFrequency=count;
  return this;
}
Program: 52660
Project: 52660
Buggy source:
public TrainerBuilder lowerCaseFirstLetterFrequency(int count){
  this.lowerCaseFirstLetterFrequency=lowerCaseFirstLetterFrequency;
  return this;
}

Fixed version (ground truth):
public TrainerBuilder lowerCaseFirstLetterFrequency(int count){
  this.lowerCaseFirstLetterFrequency=count;
  return this;
}
Program: 52661
Project: 52661
Buggy source:
private void extractData(Path p,Path outRoot,int resultLimit,int maxAmbigiousWordCount) throws IOException {
  List<Path> files=Files.walk(p,1).filter(s -> s.toFile().isFile()).collect(Collectors.toList());
  BatchResult result=new BatchResult();
  int i=0;
  for (  Path file : files) {
    Log.info("String_Node_Str",file);
    collect(result,file,maxAmbigiousWordCount,resultLimit);
    i++;
    Log.info("String_Node_Str",i,files.size());
    if (resultLimit > 0 && result.results.size() > resultLimit) {
      break;
    }
  }
  String s=p.toFile().getName();
  Log.info("String_Node_Str");
  Path out=outRoot.resolve(s + "String_Node_Str");
  Path amb=outRoot.resolve(s + "String_Node_Str");
  try (PrintWriter pwu=new PrintWriter(out.toFile(),"String_Node_Str");PrintWriter pwa=new PrintWriter(amb.toFile(),"String_Node_Str")){
    for (    ResultSentence sentence : result.results) {
      pwu.println("String_Node_Str" + sentence.sentence);
      pwa.println("String_Node_Str" + sentence.sentence);
      for (      AmbiguityAnalysis analysis : sentence.results) {
        List<String> forTrain=analysis.getForTrainingOutput();
        forTrain.forEach(pwu::println);
        pwa.println(analysis.token);
        for (        AnalysisDecision r : analysis.choices) {
          pwa.println(r.analysis.formatLong());
        }
      }
      pwu.println();
      pwa.println();
    }
  }
 }

Fixed version (ground truth):
private void extractData(Path p,Path outRoot,int resultLimit,int maxAmbigiousWordCount) throws IOException {
  List<Path> files=Files.walk(p,1).filter(s -> s.toFile().isFile()).collect(Collectors.toList());
  BatchResult result=new BatchResult();
  int i=0;
  for (  Path file : files) {
    Log.info("String_Node_Str",file);
    LinkedHashSet<String> sentences=getSentences(p);
    collect(result,sentences,maxAmbigiousWordCount,resultLimit);
    i++;
    Log.info("String_Node_Str",i,files.size());
    if (resultLimit > 0 && result.results.size() > resultLimit) {
      break;
    }
  }
  String s=p.toFile().getName();
  Log.info("String_Node_Str");
  Path out=outRoot.resolve(s + "String_Node_Str");
  Path amb=outRoot.resolve(s + "String_Node_Str");
  try (PrintWriter pwu=new PrintWriter(out.toFile(),"String_Node_Str");PrintWriter pwa=new PrintWriter(amb.toFile(),"String_Node_Str")){
    for (    ResultSentence sentence : result.results) {
      pwu.println("String_Node_Str" + sentence.sentence);
      pwa.println("String_Node_Str" + sentence.sentence);
      for (      AmbiguityAnalysis analysis : sentence.results) {
        List<String> forTrain=analysis.getForTrainingOutput();
        forTrain.forEach(pwu::println);
        pwa.println(analysis.token);
        for (        AnalysisDecision r : analysis.choices) {
          pwa.println(r.analysis.formatLong());
        }
      }
      pwu.println();
      pwa.println();
    }
  }
 }
Program: 52662
Project: 52662
Buggy source:
public static void main(String[] args) throws IOException {
  Path p=Paths.get("String_Node_Str");
  Path outRoot=Paths.get("String_Node_Str");
  Files.createDirectories(outRoot);
  acceptWordPredicates.add(maxAnalysisCount(10));
  acceptWordPredicates.add(hasAnalysis());
  ignoreSentencePredicates.add(contains("String_Node_Str"));
  ignoreSentencePredicates.add(contains("String_Node_Str"));
  ignoreSentencePredicates.add(probablyNotTurkish());
  ignoreSentencePredicates.add(tooLongSentence(25));
  new GenerateDataWithRules().extractData(p,outRoot,150000,0);
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException {
  Path p=Paths.get("String_Node_Str");
  Path outRoot=Paths.get("String_Node_Str");
  Files.createDirectories(outRoot);
  acceptWordPredicates.add(maxAnalysisCount(10));
  acceptWordPredicates.add(hasAnalysis());
  ignoreSentencePredicates.add(contains("String_Node_Str"));
  ignoreSentencePredicates.add(contains("String_Node_Str"));
  ignoreSentencePredicates.add(probablyNotTurkish());
  ignoreSentencePredicates.add(tooLongSentence(25));
  new GenerateDataWithRules().extractHighlyAmbigiousWordSentences(p,outRoot,3,1000);
}
Program: 52664
Project: 52664
Buggy source:
private WordAnalysis analyzeWithoutCache(Token token){
  String word=token.getText();
  String s=normalizeForAnalysis(word);
  if (s.length() == 0) {
    return WordAnalysis.EMPTY_INPUT_RESULT;
  }
  List<SingleAnalysis> result=analyzer.analyze(s);
  if (result.size() == 0) {
    result=analyzeWordsWithApostrophe(s);
  }
  if (result.size() == 0 && useUnidentifiedTokenAnalyzer) {
    result=unidentifiedTokenAnalyzer.analyze(token);
  }
  if (result.size() == 1 && result.get(0).getDictionaryItem().isUnknown()) {
    result=Collections.emptyList();
  }
  return new WordAnalysis(word,s,result);
}

Fixed version (ground truth):
private WordAnalysis analyzeWithoutCache(Token token){
  String word=token.getText();
  String s=normalizeForAnalysis(word);
  if (s.length() == 0) {
    return WordAnalysis.EMPTY_INPUT_RESULT;
  }
  List<SingleAnalysis> result=analyzer.analyze(s);
  if (result.size() == 0) {
    result=analyzeWordsWithApostrophe(s);
  }
  if (result.size() == 0 && useUnidentifiedTokenAnalyzer) {
    result=unidentifiedTokenAnalyzer.analyze(token);
  }
  if (result.size() == 0) {
    result=new ArrayList<>(1);
    result.add(SingleAnalysis.unknown(word));
  }
  return new WordAnalysis(word,s,result);
}
Program: 52666
Project: 52666
Buggy source:
@Override public SentenceAnalysis disambiguate(String sentence,List<WordAnalysis> allAnalyses){
  ParseResult best=decoder.bestPath(allAnalyses);
  List<SentenceWordAnalysis> l=new ArrayList<>();
  for (int i=0; i < allAnalyses.size(); i++) {
    l.add(new SentenceWordAnalysis(best.bestParse.get(i),allAnalyses.get(i)));
  }
  return new SentenceAnalysis(sentence,l);
}

Fixed version (ground truth):
@Override public SentenceAnalysis disambiguate(String sentence,List<WordAnalysis> allAnalyses){
  ParseResult best=decoder.bestPath(allAnalyses);
  List<SentenceWordAnalysis> l=new ArrayList<>();
  for (int i=0; i < allAnalyses.size(); i++) {
    WordAnalysis wordAnalysis=allAnalyses.get(i);
    SingleAnalysis analysis=best.bestParse.get(i);
    l.add(new SentenceWordAnalysis(analysis,wordAnalysis));
  }
  return new SentenceAnalysis(sentence,l);
}
Program: 52667
Project: 52667
Buggy source:
private Node<T> walkToNode(String input,Consumer<Node<T>> nodeCallback){
  Node<T> node=root;
  int i=0;
  while (i < input.length()) {
    node=node.getChildNode(input.charAt(i));
    if (node == null) {
      break;
    }
    char[] fragment=node.fragment;
    boolean fail=false;
    int j;
    for (j=0; j < fragment.length && i < input.length(); j++, i++) {
      if (!fail && fragment[j] != input.charAt(i)) {
        fail=true;
      }
    }
    if (nodeCallback != null && !fail && j == fragment.length && node.hasItem()) {
      nodeCallback.accept(node);
    }
  }
  return node;
}

Fixed version (ground truth):
private Node<T> walkToNode(String input,Consumer<Node<T>> nodeCallback){
  Node<T> node=root;
  int i=0;
  while (i < input.length()) {
    node=node.getChildNode(input.charAt(i));
    if (node == null) {
      break;
    }
    char[] fragment=node.fragment;
    boolean fail=false;
    int j;
    for (j=0; j < fragment.length && i < input.length(); j++, i++) {
      if (!fail && fragment[j] != input.charAt(i)) {
        fail=true;
      }
    }
    if (nodeCallback != null) {
      if (!fail && j == fragment.length) {
        if (node.hasItem()) {
          nodeCallback.accept(node);
        }
      }
 else {
        break;
      }
    }
  }
  return node;
}
Program: 52668
Project: 52668
Buggy source:
/** 
 * Finds the last position of common chars for 2 char arrays relative to a given index.
 * @param input input char array to look in the fragment
 * @param start start index where method starts looking the input in the fragment
 * @param fragment the char array to look input array.
 * @return <pre> for input: "foo" fragment = "foobar" index = 0, returns 3 for input: "fool" fragment = "foobar" index = 0, returns 3 for input: "fool" fragment = "foobar" index = 1, returns 2 for input: "foo" fragment = "obar" index = 1, returns 2 for input: "xyzfoo" fragment = "foo" index = 3, returns 2 for input: "xyzfoo" fragment = "xyz" index = 3, returns 0 for input: "xyz" fragment = "abc" index = 0, returns 0 </pre>
 */
private static int getSplitPoint(char[] input,int start,char[] fragment){
  int fragmentIndex=0;
  while (start < input.length && fragmentIndex < fragment.length && input[start++] == fragment[fragmentIndex]) {
    fragmentIndex++;
  }
  return fragmentIndex;
}

Fixed version (ground truth):
/** 
 * Finds the last position of common chars for 2 char arrays relative to a given index.
 * @param input input char array to look in the fragment
 * @param start start index where method starts looking the input in the fragment
 * @param fragment the char array to look input array.
 * @return <pre>for input: "foo" fragment = "foobar" index = 0, returns 3 for input: "fool" fragment = "foobar" index = 0, returns 3 for input: "fool" fragment = "foobar" index = 1, returns 2 for input: "foo" fragment = "obar" index = 1, returns 2 for input: "xyzfoo" fragment = "foo" index = 3, returns 2 for input: "xyzfoo" fragment = "xyz" index = 3, returns 0 for input: "xyz" fragment = "abc" index = 0, returns 0 </pre>
 */
private static int getSplitPoint(char[] input,int start,char[] fragment){
  int fragmentIndex=0;
  while (start < input.length && fragmentIndex < fragment.length && input[start++] == fragment[fragmentIndex]) {
    fragmentIndex++;
  }
  return fragmentIndex;
}
Program: 52669
Project: 52669
Buggy source:
private Node<T> walkToNode(String input,Consumer<Node<T>> nodeCallback){
  Node<T> node=root;
  int i=0;
  while (i < input.length()) {
    node=node.getChildNode(input.charAt(i));
    if (node == null) {
      break;
    }
    char[] fragment=node.fragment;
    int j=0;
    while (j < fragment.length && i < input.length() && fragment[j++] == input.charAt(i++)) {
    }
    if (nodeCallback != null) {
      if (j == fragment.length && i <= input.length() && node.hasItem()) {
        nodeCallback.accept(node);
      }
    }
  }
  return node;
}

Fixed version (ground truth):
private Node<T> walkToNode(String input,Consumer<Node<T>> nodeCallback){
  Node<T> node=root;
  int i=0;
  while (i < input.length()) {
    node=node.getChildNode(input.charAt(i));
    if (node == null) {
      break;
    }
    char[] fragment=node.fragment;
    boolean fail=false;
    int j;
    for (j=0; j < fragment.length && i < input.length(); j++, i++) {
      if (!fail && fragment[j] != input.charAt(i)) {
        fail=true;
      }
    }
    if (nodeCallback != null && !fail && j == fragment.length && node.hasItem()) {
      nodeCallback.accept(node);
    }
  }
  return node;
}
Program: 52670
Project: 52670
Buggy source:
/** 
 * Finds the last position of common chars for 2 char arrays relative to a given index.
 * @param input input char array to look in the fragment
 * @param start start index where method starts looking the input in the fragment
 * @param fragment the char array to look input array.
 * @return for input: "foo" fragment = "foobar" index = 0, returns 3 for input: "fool" fragment ="foobar" index = 0, returns 3 for input: "fool" fragment = "foobar" index = 1, returns 2 for input: "foo" fragment = "obar" index = 1, returns 2 for input: "xyzfoo" fragment = "foo" index = 3, returns 2 for input: "xyzfoo" fragment = "xyz" index = 3, returns 0 for input: "xyz" fragment = "abc" index = 0, returns 0
 */
private static int getSplitPoint(char[] input,int start,char[] fragment){
  int fragmentIndex=0;
  while (start < input.length && fragmentIndex < fragment.length && input[start++] == fragment[fragmentIndex]) {
    fragmentIndex++;
  }
  return fragmentIndex;
}

Fixed version (ground truth):
/** 
 * Finds the last position of common chars for 2 char arrays relative to a given index.
 * @param input input char array to look in the fragment
 * @param start start index where method starts looking the input in the fragment
 * @param fragment the char array to look input array.
 * @return <pre> for input: "foo" fragment = "foobar" index = 0, returns 3 for input: "fool" fragment = "foobar" index = 0, returns 3 for input: "fool" fragment = "foobar" index = 1, returns 2 for input: "foo" fragment = "obar" index = 1, returns 2 for input: "xyzfoo" fragment = "foo" index = 3, returns 2 for input: "xyzfoo" fragment = "xyz" index = 3, returns 0 for input: "xyz" fragment = "abc" index = 0, returns 0 </pre>
 */
private static int getSplitPoint(char[] input,int start,char[] fragment){
  int fragmentIndex=0;
  while (start < input.length && fragmentIndex < fragment.length && input[start++] == fragment[fragmentIndex]) {
    fragmentIndex++;
  }
  return fragmentIndex;
}
Program: 52671
Project: 52671
Buggy source:
@Test public void stemsWrongMatchTest(){
  List<Item> items=createitems("String_Node_Str","String_Node_Str","String_Node_Str");
  additems(items);
  checkitemsExist(items);
  checkitemsMatches("String_Node_Str",createitems("String_Node_Str"));
  checkitemsMustNotMatch("String_Node_Str",createitems("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void stemsWrongMatchTest(){
  List<Item> items=createitems("String_Node_Str","String_Node_Str","String_Node_Str");
  additems(items);
  checkitemsExist(items);
  checkitemsMustNotMatch("String_Node_Str",createitems("String_Node_Str","String_Node_Str"));
}
Program: 52672
Project: 52672
Buggy source:
public void removeDictionaryItem(DictionaryItem item){
  lock.writeLock().lock();
  try {
    List<StemTransition> transitions=generate(item);
    for (    StemTransition transition : transitions) {
      stemTransitionTrie.add(transition.surface,transition);
    }
    if (differentStemItems.containsKey(item)) {
      differentStemItems.removeAll(item);
    }
  }
 catch (  Exception e) {
    Log.warn("String_Node_Str",e.getMessage());
  }
 finally {
    lock.writeLock().unlock();
  }
}

Fixed version (ground truth):
public void removeDictionaryItem(DictionaryItem item){
  lock.writeLock().lock();
  try {
    List<StemTransition> transitions=generate(item);
    for (    StemTransition transition : transitions) {
      stemTransitionTrie.remove(transition.surface,transition);
    }
    if (differentStemItems.containsKey(item)) {
      differentStemItems.removeAll(item);
    }
  }
 catch (  Exception e) {
    Log.warn("String_Node_Str",e.getMessage());
  }
 finally {
    lock.writeLock().unlock();
  }
}
Program: 52673
Project: 52673
Buggy source:
private List<SingleAnalysis> tryWithoutApostrophe(String word){
  String normalized=TurkishAlphabet.INSTANCE.normalize(word);
  String pronunciation=guessPronunciation(normalized.replaceAll("String_Node_Str","String_Node_Str"));
  DictionaryItem itemProp=new DictionaryItem(Turkish.capitalize(normalized),normalized,pronunciation,PrimaryPos.Noun,normalized.contains("String_Node_Str") ? SecondaryPos.Abbreviation : SecondaryPos.ProperNoun);
  itemProp.attributes.add(RootAttribute.Runtime);
  analyzer.getStemTransitions().addDictionaryItem(itemProp);
  List<SingleAnalysis> properResults=analyzer.analyze(normalized);
  analyzer.getStemTransitions().removeDictionaryItem(itemProp);
  return properResults;
}

Fixed version (ground truth):
private List<SingleAnalysis> tryWithoutApostrophe(String word){
  String normalized=TurkishAlphabet.INSTANCE.normalize(word);
  String pronunciation=guessPronunciation(normalized.replaceAll("String_Node_Str","String_Node_Str"));
  DictionaryItem itemProp=new DictionaryItem(Turkish.capitalize(normalized),normalized,pronunciation,PrimaryPos.Noun,normalized.contains("String_Node_Str") ? SecondaryPos.Abbreviation : SecondaryPos.ProperNoun);
  boolean itemDoesNotExist=!lexicon.containsItem(itemProp);
  if (!itemDoesNotExist) {
    itemProp.attributes.add(RootAttribute.Runtime);
    analyzer.getStemTransitions().addDictionaryItem(itemProp);
  }
  List<SingleAnalysis> properResults=analyzer.analyze(normalized);
  if (itemDoesNotExist) {
    analyzer.getStemTransitions().removeDictionaryItem(itemProp);
  }
  return properResults;
}
Program: 52674
Project: 52674
Buggy source:
public UnidentifiedTokenAnalyzer(InterpretingAnalyzer analyzer){
  this.analyzer=analyzer;
}

Fixed version (ground truth):
public UnidentifiedTokenAnalyzer(InterpretingAnalyzer analyzer){
  this.analyzer=analyzer;
  this.lexicon=analyzer.getLexicon();
}
Program: 52675
Project: 52675
Buggy source:
private List<SingleAnalysis> tryWordWithApostrophe(String word){
  int index=word.indexOf('\'');
  if (index < 0 || index == 0 || index == word.length() - 1) {
    return Collections.emptyList();
  }
  String stem=word.substring(0,index);
  String ending=word.substring(index + 1);
  StemAndEnding se=new StemAndEnding(stem,ending);
  String stemNormalized=TurkishAlphabet.INSTANCE.normalize(se.stem).replaceAll("String_Node_Str","String_Node_Str");
  String endingNormalized=TurkishAlphabet.INSTANCE.normalize(se.ending);
  String pronunciation=guessPronunciation(stemNormalized);
  DictionaryItem itemProp=new DictionaryItem(Turkish.capitalize(stemNormalized),stemNormalized,pronunciation,PrimaryPos.Noun,SecondaryPos.ProperNoun);
  itemProp.attributes.add(RootAttribute.Runtime);
  analyzer.getStemTransitions().addDictionaryItem(itemProp);
  String toParse=stemNormalized + endingNormalized;
  List<SingleAnalysis> properResults=analyzer.analyze(toParse);
  analyzer.getStemTransitions().removeDictionaryItem(itemProp);
  return properResults;
}

Fixed version (ground truth):
private List<SingleAnalysis> tryWordWithApostrophe(String word){
  int index=word.indexOf('\'');
  if (index < 0 || index == 0 || index == word.length() - 1) {
    return Collections.emptyList();
  }
  String stem=word.substring(0,index);
  String ending=word.substring(index + 1);
  StemAndEnding se=new StemAndEnding(stem,ending);
  String stemNormalized=TurkishAlphabet.INSTANCE.normalize(se.stem).replaceAll("String_Node_Str","String_Node_Str");
  String endingNormalized=TurkishAlphabet.INSTANCE.normalize(se.ending);
  String pronunciation=guessPronunciation(stemNormalized);
  DictionaryItem itemProp=new DictionaryItem(Turkish.capitalize(stemNormalized),stemNormalized,pronunciation,PrimaryPos.Noun,SecondaryPos.ProperNoun);
  boolean itemDoesNotExist=!lexicon.containsItem(itemProp);
  if (itemDoesNotExist) {
    itemProp.attributes.add(RootAttribute.Runtime);
    analyzer.getStemTransitions().addDictionaryItem(itemProp);
  }
  String toParse=stemNormalized + endingNormalized;
  List<SingleAnalysis> properResults=analyzer.analyze(toParse);
  if (itemDoesNotExist) {
    analyzer.getStemTransitions().removeDictionaryItem(itemProp);
  }
  return properResults;
}
Program: 52676
Project: 52676
Buggy source:
@Test public void test2() throws IOException {
  TurkishMorphology morphology=TurkishMorphology.builder().addDefaultDictionaries().disableCache().build();
  morphology.analyze("String_Node_Str");
}

Fixed version (ground truth):
@Test public void test2(){
  TurkishMorphology morphology=TurkishMorphology.builder().addDictionaryLines("String_Node_Str").disableCache().build();
  Assert.assertEquals(0,morphology.analyze("String_Node_Str").analysisCount());
  Assert.assertEquals(1,morphology.analyze("String_Node_Str").analysisCount());
}