nus-yam/ex-repair huggingface dataset:
Program: 157164
Project: 157164
Buggy source:
public void onClick(DialogInterface di,int position){
switch (position) {
case 0:
    launchSettings();
  break;
case 1:
launchDictionaryOverriding();
break;
case 2:
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).showInputMethodPicker();
break;
case 3:
mSuggest.setIncognitoMode(!mSuggest.isIncognitoMode());
getQuickKeyHistoryRecords().setIncognitoMode(mSuggest.isIncognitoMode());
setupInputViewWatermark();
break;
default :
throw new IllegalArgumentException("String_Node_Str" + position + "String_Node_Str");
}
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface di,int position){
switch (position) {
case 0:
    launchSettings();
  break;
case 1:
launchDictionaryOverriding();
break;
case 2:
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).showInputMethodPicker();
break;
case 3:
mSuggest.setIncognitoMode(!mSuggest.isIncognitoMode());
getQuickKeyHistoryRecords().setIncognitoMode(mSuggest.isIncognitoMode());
setupInputViewWatermark();
break;
default :
throw new IllegalArgumentException("String_Node_Str" + position + "String_Node_Str");
}
}
Program: 157165
Project: 157165
Buggy source:
public void onMultiTapEnded(){
  final InputConnection ic=getCurrentInputConnection();
  if (ic != null)   ic.endBatchEdit();
  updateShiftStateNow();
}

Fixed version (ground truth):
@Override public void onMultiTapEnded(){
  final InputConnection ic=getCurrentInputConnection();
  if (ic != null)   ic.endBatchEdit();
  updateShiftStateNow();
}
Program: 157166
Project: 157166
Buggy source:
@NonNull protected KeyboardSwitcher createKeyboardSwitcher(){
  return new KeyboardSwitcher(this,getApplicationContext());
}

Fixed version (ground truth):
@NonNull @Override protected KeyboardSwitcher createKeyboardSwitcher(){
  return new KeyboardSwitcher(this,getApplicationContext());
}
Program: 157167
Project: 157167
Buggy source:
public void onRelease(int primaryCode){
  InputConnection ic=getCurrentInputConnection();
  if (primaryCode == KeyCodes.SHIFT) {
    mShiftKeyState.onRelease(mAskPrefs.getMultiTapTimeout(),mAskPrefs.getLongPressTimeout());
    handleShift();
  }
 else {
    if (mShiftKeyState.onOtherKeyReleased()) {
      updateShiftStateNow();
    }
  }
  if (primaryCode == KeyCodes.CTRL) {
    sendKeyUp(ic,113);
    mControlKeyState.onRelease(mAskPrefs.getMultiTapTimeout(),mAskPrefs.getLongPressTimeout());
    handleControl();
  }
 else {
    mControlKeyState.onOtherKeyReleased();
  }
}

Fixed version (ground truth):
@Override public void onRelease(int primaryCode){
  InputConnection ic=getCurrentInputConnection();
  if (primaryCode == KeyCodes.SHIFT) {
    mShiftKeyState.onRelease(mAskPrefs.getMultiTapTimeout(),mAskPrefs.getLongPressTimeout());
    handleShift();
  }
 else {
    if (mShiftKeyState.onOtherKeyReleased()) {
      updateShiftStateNow();
    }
  }
  if (primaryCode == KeyCodes.CTRL) {
    sendKeyUp(ic,113);
    mControlKeyState.onRelease(mAskPrefs.getMultiTapTimeout(),mAskPrefs.getLongPressTimeout());
    handleControl();
  }
 else {
    mControlKeyState.onOtherKeyReleased();
  }
}
Program: 157168
Project: 157168
Buggy source:
public void updateRingerMode(){
  mSilentMode=(mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL);
}

Fixed version (ground truth):
@Override public void updateRingerMode(){
  mSilentMode=(mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL);
}
Program: 157169
Project: 157169
Buggy source:
private void showOptionsMenu(){
  showOptionsDialogWithData(getText(R.string.ime_name),R.mipmap.ic_launcher,new CharSequence[]{getText(R.string.ime_settings),getText(R.string.override_dictionary),getText(R.string.change_ime),getString(R.string.switch_incognito_template,getText(R.string.switch_incognito))},new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface di,    int position){
switch (position) {
case 0:
        launchSettings();
      break;
case 1:
    launchDictionaryOverriding();
  break;
case 2:
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).showInputMethodPicker();
break;
case 3:
mSuggest.setIncognitoMode(!mSuggest.isIncognitoMode());
getQuickKeyHistoryRecords().setIncognitoMode(mSuggest.isIncognitoMode());
setupInputViewWatermark();
break;
default :
throw new IllegalArgumentException("String_Node_Str" + position + "String_Node_Str");
}
}
}
);
}

Fixed version (ground truth):
private void showOptionsMenu(){
  showOptionsDialogWithData(getText(R.string.ime_name),R.mipmap.ic_launcher,new CharSequence[]{getText(R.string.ime_settings),getText(R.string.override_dictionary),getText(R.string.change_ime),getString(R.string.switch_incognito_template,getText(R.string.switch_incognito))},new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface di,    int position){
switch (position) {
case 0:
        launchSettings();
      break;
case 1:
    launchDictionaryOverriding();
  break;
case 2:
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).showInputMethodPicker();
break;
case 3:
mSuggest.setIncognitoMode(!mSuggest.isIncognitoMode());
getQuickKeyHistoryRecords().setIncognitoMode(mSuggest.isIncognitoMode());
setupInputViewWatermark();
break;
default :
throw new IllegalArgumentException("String_Node_Str" + position + "String_Node_Str");
}
}
}
);
}
Program: 157170
Project: 157170
Buggy source:
/** 
 * Commits the chosen word to the text field and saves it for later retrieval.
 * @param wordToCommit the suggestion picked by the user to be committed to the textfield
 * @param correcting   this is a correction commit
 */
protected void commitWordToInput(@NonNull CharSequence wordToCommit,boolean correcting){
  mWord.setPreferredWord(wordToCommit);
  InputConnection ic=getCurrentInputConnection();
  if (ic != null) {
    if (correcting) {
      AnyApplication.getDeviceSpecific().commitCorrectionToInputConnection(ic,mGlobalCursorPosition - mWord.getTypedWord().length(),mWord.getTypedWord(),mWord.getPreferredWord());
      getInputView().popTextOutOfKey(mWord.getPreferredWord());
    }
 else {
      ic.commitText(wordToCommit,1);
    }
  }
  mCommittedWord=wordToCommit;
  mUndoCommitCursorPosition=UNDO_COMMIT_WAITING_TO_RECORD_POSITION;
  clearSuggestions();
}

Fixed version (ground truth):
/** 
 * Commits the chosen word to the text field and saves it for later retrieval.
 * @param wordToCommit the suggestion picked by the user to be committed to the textfield
 * @param correcting   this is a correction commit
 */
@Override protected void commitWordToInput(@NonNull CharSequence wordToCommit,boolean correcting){
  mWord.setPreferredWord(wordToCommit);
  InputConnection ic=getCurrentInputConnection();
  if (ic != null) {
    if (correcting) {
      AnyApplication.getDeviceSpecific().commitCorrectionToInputConnection(ic,mGlobalCursorPosition - mWord.getTypedWord().length(),mWord.getTypedWord(),mWord.getPreferredWord());
      getInputView().popTextOutOfKey(mWord.getPreferredWord());
    }
 else {
      ic.commitText(wordToCommit,1);
    }
  }
  mCommittedWord=wordToCommit;
  mUndoCommitCursorPosition=UNDO_COMMIT_WAITING_TO_RECORD_POSITION;
  clearSuggestions();
}
Program: 157172
Project: 157172
Buggy source:
public float getKeysHeightFactorInLandscape(){
  return mKeysHeightFactorInLandscape;
}

Fixed version (ground truth):
@Override public float getKeysHeightFactorInLandscape(){
  return mKeysHeightFactorInLandscape;
}
Program: 157173
Project: 157173
Buggy source:
public boolean getUseFullScreenInputInLandscape(){
  return mUseFullScreenInputInLandscape;
}

Fixed version (ground truth):
@Override public boolean getUseFullScreenInputInLandscape(){
  return mUseFullScreenInputInLandscape;
}
Program: 157174
Project: 157174
Buggy source:
public int getGestureSwipeDownKeyCode(){
  return mSwipeDownKeyCode;
}

Fixed version (ground truth):
@Override public int getGestureSwipeDownKeyCode(){
  return mSwipeDownKeyCode;
}
Program: 157175
Project: 157175
Buggy source:
public boolean shouldShowPopupForLanguageSwitch(){
  return mShouldPopupForLanguageSwitch;
}

Fixed version (ground truth):
@Override public boolean shouldShowPopupForLanguageSwitch(){
  return mShouldPopupForLanguageSwitch;
}
Program: 157176
Project: 157176
Buggy source:
public void removeChangedListener(OnSharedPreferenceChangeListener listener){
  mPreferencesChangedListeners.remove(listener);
}

Fixed version (ground truth):
@Override public void removeChangedListener(OnSharedPreferenceChangeListener listener){
  mPreferencesChangedListeners.remove(listener);
}
Program: 157177
Project: 157177
Buggy source:
public float getKeysHeightFactorInPortrait(){
  return mKeysHeightFactorInPortrait;
}

Fixed version (ground truth):
@Override public float getKeysHeightFactorInPortrait(){
  return mKeysHeightFactorInPortrait;
}
Program: 157178
Project: 157178
Buggy source:
public boolean getActionKeyInvisibleWhenRequested(){
  return mActionKeyInvisibleWhenRequested;
}

Fixed version (ground truth):
@Override public boolean getActionKeyInvisibleWhenRequested(){
  return mActionKeyInvisibleWhenRequested;
}
Program: 157179
Project: 157179
Buggy source:
public boolean getShowKeyboardNameText(){
  return mShowKeyboardNameText;
}

Fixed version (ground truth):
@Override public boolean getShowKeyboardNameText(){
  return mShowKeyboardNameText;
}
Program: 157180
Project: 157180
Buggy source:
public String getDomainText(){
  return mDomainText;
}

Fixed version (ground truth):
@Override public String getDomainText(){
  return mDomainText;
}
Program: 157181
Project: 157181
Buggy source:
public boolean use16KeysSymbolsKeyboards(){
  return mUse16KeysSymbolsKeyboard;
}

Fixed version (ground truth):
@Override public boolean use16KeysSymbolsKeyboards(){
  return mUse16KeysSymbolsKeyboard;
}
Program: 157182
Project: 157182
Buggy source:
public boolean useChewbaccaNotifications(){
  return mUseChewbacca;
}

Fixed version (ground truth):
@Override public boolean useChewbaccaNotifications(){
  return mUseChewbacca;
}
Program: 157183
Project: 157183
Buggy source:
public int getGestureSeparateKeyCode(){
  return mSeparateKeyCode;
}

Fixed version (ground truth):
@Override public int getGestureSeparateKeyCode(){
  return mSeparateKeyCode;
}
Program: 157184
Project: 157184
Buggy source:
public boolean shouldSwapPunctuationAndSpace(){
  return mSwapPunctuationAndSpace;
}

Fixed version (ground truth):
@Override public boolean shouldSwapPunctuationAndSpace(){
  return mSwapPunctuationAndSpace;
}
Program: 157185
Project: 157185
Buggy source:
public boolean getUseRepeatingKeys(){
  return mUseKeyRepeat;
}

Fixed version (ground truth):
@Override public boolean getUseRepeatingKeys(){
  return mUseKeyRepeat;
}
Program: 157186
Project: 157186
Buggy source:
public boolean useBackword(){
  return mUseBackword;
}

Fixed version (ground truth):
@Override public boolean useBackword(){
  return mUseBackword;
}
Program: 157187
Project: 157187
Buggy source:
public AnimationsLevel getAnimationsLevel(){
  return mAnimationsLevel;
}

Fixed version (ground truth):
@Override public AnimationsLevel getAnimationsLevel(){
  return mAnimationsLevel;
}
Program: 157188
Project: 157188
Buggy source:
public boolean getShowKeyPreview(){
  return mShowKeyPreview;
}

Fixed version (ground truth):
@Override public boolean getShowKeyPreview(){
  return mShowKeyPreview;
}
Program: 157189
Project: 157189
Buggy source:
public boolean showKeyPreviewAboveKey(){
  return mKeyPreviewAboveKey;
}

Fixed version (ground truth):
@Override public boolean showKeyPreviewAboveKey(){
  return mKeyPreviewAboveKey;
}
Program: 157190
Project: 157190
Buggy source:
public void addChangedListener(OnSharedPreferenceChangeListener listener){
  mPreferencesChangedListeners.add(listener);
}

Fixed version (ground truth):
@Override public void addChangedListener(OnSharedPreferenceChangeListener listener){
  mPreferencesChangedListeners.add(listener);
}
Program: 157191
Project: 157191
Buggy source:
public boolean getSwitchKeyboardOnSpace(){
  return mSwitchKeyboardOnSpace;
}

Fixed version (ground truth):
@Override public boolean getSwitchKeyboardOnSpace(){
  return mSwitchKeyboardOnSpace;
}
Program: 157192
Project: 157192
Buggy source:
public boolean getInsertSpaceAfterCandidatePick(){
  return mInsertSpaceAfterCandidatePick;
}

Fixed version (ground truth):
@Override public boolean getInsertSpaceAfterCandidatePick(){
  return mInsertSpaceAfterCandidatePick;
}
Program: 157193
Project: 157193
Buggy source:
public int getGestureSwipeUpKeyCode(boolean fromSpaceBar){
  return fromSpaceBar ? mSwipeUpFromSpaceBarKeyCode : mSwipeUpKeyCode;
}

Fixed version (ground truth):
@Override public int getGestureSwipeUpKeyCode(boolean fromSpaceBar){
  return fromSpaceBar ? mSwipeUpFromSpaceBarKeyCode : mSwipeUpKeyCode;
}
Program: 157194
Project: 157194
Buggy source:
public int getGesturePinchKeyCode(){
  return mPinchKeyCode;
}

Fixed version (ground truth):
@Override public int getGesturePinchKeyCode(){
  return mPinchKeyCode;
}
Program: 157195
Project: 157195
Buggy source:
public boolean hideSoftKeyboardWhenPhysicalKeyPressed(){
  return mHideSoftKeyboardWhenPhysicalKeyPressed;
}

Fixed version (ground truth):
@Override public boolean hideSoftKeyboardWhenPhysicalKeyPressed(){
  return mHideSoftKeyboardWhenPhysicalKeyPressed;
}
Program: 157196
Project: 157196
Buggy source:
public boolean getUseFullScreenInputInPortrait(){
  return mUseFullScreenInputInPortrait;
}

Fixed version (ground truth):
@Override public boolean getUseFullScreenInputInPortrait(){
  return mUseFullScreenInputInPortrait;
}
Program: 157197
Project: 157197
Buggy source:
public boolean isDoubleSpaceChangesToPeriod(){
  return mIsDoubleSpaceChangesToPeroid;
}

Fixed version (ground truth):
@Override public boolean isDoubleSpaceChangesToPeriod(){
  return mIsDoubleSpaceChangesToPeroid;
}
Program: 157198
Project: 157198
Buggy source:
public int getGestureSwipeLeftKeyCode(boolean fromSpaceBar,boolean withTwoFingers){
  return fromSpaceBar ? mSwipeLeftFromSpaceBarKeyCode : withTwoFingers ? mSwipeLeftWithTwoFingersKeyCode : mSwipeLeftKeyCode;
}

Fixed version (ground truth):
@Override public int getGestureSwipeLeftKeyCode(boolean fromSpaceBar,boolean withTwoFingers){
  return fromSpaceBar ? mSwipeLeftFromSpaceBarKeyCode : withTwoFingers ? mSwipeLeftWithTwoFingersKeyCode : mSwipeLeftKeyCode;
}
Program: 157200
Project: 157200
Buggy source:
public int getGestureSwipeRightKeyCode(boolean fromSpaceBar,boolean withTwoFingers){
  return fromSpaceBar ? mSwipeRightFromSpaceBarKeyCode : withTwoFingers ? mSwipeRightWithTwoFingersKeyCode : mSwipeRightKeyCode;
}

Fixed version (ground truth):
@Override public int getGestureSwipeRightKeyCode(boolean fromSpaceBar,boolean withTwoFingers){
  return fromSpaceBar ? mSwipeRightFromSpaceBarKeyCode : withTwoFingers ? mSwipeRightWithTwoFingersKeyCode : mSwipeRightKeyCode;
}
Program: 157201
Project: 157201
Buggy source:
public void onAnimationRepeat(Animation animation){
}

Fixed version (ground truth):
@Override public void onAnimationRepeat(Animation animation){
}
Program: 157202
Project: 157202
Buggy source:
public void onAnimationEnd(Animation animation){
  mCloseText.setVisibility(View.GONE);
  mCloseText=null;
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animation animation){
  mCloseText.setVisibility(View.GONE);
  mCloseText=null;
}
Program: 157203
Project: 157203
Buggy source:
public void onAnimationStart(Animation animation){
}

Fixed version (ground truth):
@Override public void onAnimationStart(Animation animation){
}
Program: 157204
Project: 157204
Buggy source:
public void onAnimationEnd(Animation animation){
  final com.anysoftkeyboard.keyboards.views.AnyKeyboardView view=(com.anysoftkeyboard.keyboards.views.AnyKeyboardView)mIme.getInputView();
  if (view != null)   view.requestInAnimation(getEndAnimation(mCurrentAnimationType));
  mIme.onKey(mTargetKeyCode,null,-1,new int[]{mTargetKeyCode},false);
}

Fixed version (ground truth):
@Override public void onAnimationEnd(Animation animation){
  final com.anysoftkeyboard.keyboards.views.AnyKeyboardView view=(com.anysoftkeyboard.keyboards.views.AnyKeyboardView)mIme.getInputView();
  if (view != null)   view.requestInAnimation(getEndAnimation(mCurrentAnimationType));
  mIme.onKey(mTargetKeyCode,null,-1,new int[]{mTargetKeyCode},false);
}
Program: 157205
Project: 157205
Buggy source:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  setAnimations();
}

Fixed version (ground truth):
@Override public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key){
  setAnimations();
}
Program: 157206
Project: 157206
Buggy source:
public void onAnimationRepeat(Animation animation){
}

Fixed version (ground truth):
@Override public void onAnimationRepeat(Animation animation){
}
Program: 157207
Project: 157207
Buggy source:
public void onAnimationStart(Animation animation){
}

Fixed version (ground truth):
@Override public void onAnimationStart(Animation animation){
}
Program: 157208
Project: 157208
Buggy source:
public final int getSortIndex(){
  return mSortIndex;
}

Fixed version (ground truth):
@Override public final int getSortIndex(){
  return mSortIndex;
}
Program: 157209
Project: 157209
Buggy source:
public CharSequence getName(){
  return mName;
}

Fixed version (ground truth):
@Override public CharSequence getName(){
  return mName;
}
Program: 157210
Project: 157210
Buggy source:
public final CharSequence getId(){
  return mId;
}

Fixed version (ground truth):
@Override public final CharSequence getId(){
  return mId;
}
Program: 157211
Project: 157211
Buggy source:
public final CharSequence getDescription(){
  return mDescription;
}

Fixed version (ground truth):
@Override public final CharSequence getDescription(){
  return mDescription;
}
Program: 157212
Project: 157212
Buggy source:
@Nullable public final Context getPackageContext(){
  Context c=mPackageContext.get();
  if (c == null) {
    try {
      c=mAskAppContext.createPackageContext(mPackageName,Context.CONTEXT_IGNORE_SECURITY);
      mPackageContext=new WeakReference<>(c);
    }
 catch (    NameNotFoundException e) {
      Logger.w(TAG,"String_Node_Str",mPackageName);
      Logger.w(TAG,"String_Node_Str",e);
    }
  }
  return c;
}

Fixed version (ground truth):
@Nullable @Override public final Context getPackageContext(){
  Context c=mPackageContext.get();
  if (c == null) {
    try {
      c=mAskAppContext.createPackageContext(mPackageName,Context.CONTEXT_IGNORE_SECURITY);
      mPackageContext=new WeakReference<>(c);
    }
 catch (    NameNotFoundException e) {
      Logger.w(TAG,"String_Node_Str",mPackageName);
      Logger.w(TAG,"String_Node_Str",e);
    }
  }
  return c;
}
Program: 157213
Project: 157213
Buggy source:
public String getPackageName(){
  return mPackageName;
}

Fixed version (ground truth):
@Override public String getPackageName(){
  return mPackageName;
}
Program: 157214
Project: 157214
Buggy source:
private void ensureList(){
  if (mList != null) {
    return;
  }
  View root=getView();
  if (root == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  View rawListView=root.findViewById(android.R.id.list);
  if (!(rawListView instanceof ListView)) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  mList=(ListView)rawListView;
  if (mList == null) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  mList.setOnKeyListener(mListOnKeyListener);
  mHandler.post(mRequestFocus);
}

Fixed version (ground truth):
private void ensureList(){
  if (mList != null) {
    return;
  }
  View root=getView();
  if (root == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  View rawListView=root.findViewById(android.R.id.list);
  if (!(rawListView instanceof ListView)) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  mList=(ListView)rawListView;
  mHandler.post(mRequestFocus);
}
Program: 157215
Project: 157215
Buggy source:
private void showLanguageSelectionDialog(){
  KeyboardAddOnAndBuilder[] builders=getKeyboardSwitcher().getEnabledKeyboardsBuilders();
  ArrayList<CharSequence> keyboardsIds=new ArrayList<>();
  ArrayList<CharSequence> keyboards=new ArrayList<>();
  for (  KeyboardAddOnAndBuilder keyboardBuilder : builders) {
    keyboardsIds.add(keyboardBuilder.getId());
    CharSequence name=keyboardBuilder.getName();
    keyboards.add(name);
  }
  final CharSequence[] ids=new CharSequence[keyboardsIds.size()];
  final CharSequence[] items=new CharSequence[keyboards.size()];
  keyboardsIds.toArray(ids);
  keyboards.toArray(items);
  showOptionsDialogWithData(getText(R.string.select_keyboard_popup_title),R.drawable.ic_keyboard_globe_menu,items,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface di,    int position){
      CharSequence id=ids[position];
      Logger.d(TAG,"String_Node_Str",items[position],id);
      EditorInfo currentEditorInfo=getCurrentInputEditorInfo();
      getKeyboardSwitcher().nextAlphabetKeyboard(currentEditorInfo,id.toString());
    }
  }
);
}

Fixed version (ground truth):
private void showLanguageSelectionDialog(){
  List<KeyboardAddOnAndBuilder> builders=getKeyboardSwitcher().getEnabledKeyboardsBuilders();
  ArrayList<CharSequence> keyboardsIds=new ArrayList<>();
  ArrayList<CharSequence> keyboards=new ArrayList<>();
  for (  KeyboardAddOnAndBuilder keyboardBuilder : builders) {
    keyboardsIds.add(keyboardBuilder.getId());
    CharSequence name=keyboardBuilder.getName();
    keyboards.add(name);
  }
  final CharSequence[] ids=new CharSequence[keyboardsIds.size()];
  final CharSequence[] items=new CharSequence[keyboards.size()];
  keyboardsIds.toArray(ids);
  keyboards.toArray(items);
  showOptionsDialogWithData(getText(R.string.select_keyboard_popup_title),R.drawable.ic_keyboard_globe_menu,items,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface di,    int position){
      CharSequence id=ids[position];
      Logger.d(TAG,"String_Node_Str",items[position],id);
      EditorInfo currentEditorInfo=getCurrentInputEditorInfo();
      getKeyboardSwitcher().nextAlphabetKeyboard(currentEditorInfo,id.toString());
    }
  }
);
}
Program: 157217
Project: 157217
Buggy source:
@Override public void setSuggestions(List<? extends CharSequence> suggestions,boolean completions,boolean typedWordValid,boolean haveMinimalSuggestion){
  if (mCandidateView != null) {
    mCandidateView.setSuggestions(suggestions,completions,typedWordValid,haveMinimalSuggestion && isAutoCorrect());
  }
}

Fixed version (ground truth):
@Override public void setSuggestions(List<? extends CharSequence> suggestions,boolean completions,boolean typedWordValid,boolean haveMinimalSuggestion){
  if (mCandidateView != null) {
    mCandidateView.setSuggestions(suggestions,typedWordValid,haveMinimalSuggestion && isAutoCorrect());
  }
}
Program: 157219
Project: 157219
Buggy source:
@Override public void onDisplayCompletions(CompletionInfo[] completions){
  if (BuildConfig.DEBUG) {
    Logger.d(TAG,"String_Node_Str");
    for (int i=0; i < (completions != null ? completions.length : 0); i++) {
      Logger.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ completions[i]);
    }
  }
  if (mCompletionOn || (isFullscreenMode() && (completions != null))) {
    mCompletions=completions;
    mCompletionOn=true;
    if (completions == null) {
      clearSuggestions();
      return;
    }
    List<CharSequence> stringList=new ArrayList<>();
    for (    CompletionInfo ci : completions) {
      if (ci != null)       stringList.add(ci.getText());
    }
    setSuggestions(stringList,true,true,true);
    mWord.setPreferredWord(null);
    setCandidatesViewShown(true);
  }
}

Fixed version (ground truth):
@Override public void onDisplayCompletions(CompletionInfo[] completions){
  if (BuildConfig.DEBUG) {
    Logger.d(TAG,"String_Node_Str");
    for (int i=0; i < (completions != null ? completions.length : 0); i++) {
      Logger.d(TAG,"String_Node_Str" + i + "String_Node_Str"+ completions[i]);
    }
  }
  if (mCompletionOn || (isFullscreenMode() && (completions != null))) {
    mCompletions=copyCompletionsFromAndroid(completions);
    mCompletionOn=true;
    if (mCompletions.length == 0) {
      clearSuggestions();
    }
 else {
      List<CharSequence> stringList=new ArrayList<>();
      for (      CompletionInfo ci : mCompletions) {
        if (ci != null)         stringList.add(ci.getText());
      }
      setSuggestions(stringList,true,true,true);
      mWord.setPreferredWord(null);
      setCandidatesViewShown(true);
    }
  }
}
Program: 157220
Project: 157220
Buggy source:
public WordsSQLiteConnection(Context context,String databaseFilename,String currentLocale){
  super(context,databaseFilename,null,7);
  mContext=context;
  mCurrentLocale=currentLocale;
  mDbName=databaseFilename;
}

Fixed version (ground truth):
public WordsSQLiteConnection(Context context,String databaseFilename,String currentLocale){
  super(context,databaseFilename,null,7);
  mCurrentLocale=currentLocale;
  mDbName=databaseFilename;
}
Program: 157221
Project: 157221
Buggy source:
private void updatePaths(){
  int size=mLines.size();
  if (size == 0)   return;
  LineElement line=null;
  int j=0;
  for (; j < size; j++) {
    line=mLines.get(j);
    if (line.updatePathPoints())     break;
  }
  if (j == size) {
    mLines.clear();
    return;
  }
 else {
    for (j--; j >= 0; j--) {
      mLines.remove(0);
    }
  }
  line.updatePath();
  size=mLines.size();
  LineElement lastLine=null;
  for (int i=1; i < size; i++) {
    line=mLines.get(i);
    if (line.updatePathPoints()) {
      if (lastLine == null) {
        lastLine=mLines.get(i - 1);
      }
      line.updatePathWithStartPoints(lastLine.mPoints[3],lastLine.mPoints[2]);
      lastLine=null;
    }
 else {
      mLines.remove(i);
      size=mLines.size();
    }
  }
}

Fixed version (ground truth):
private void updatePaths(){
  int size=mLines.size();
  if (size == 0)   return;
  LineElement line=null;
  int j=0;
  for (; j < size; j++) {
    line=mLines.get(j);
    if (line.updatePathPoints())     break;
  }
  if (j == size) {
    mLines.clear();
    return;
  }
 else {
    for (j--; j >= 0; j--) {
      mLines.remove(0);
    }
  }
  line.updatePath();
  size=mLines.size();
  LineElement lastLine;
  for (int i=1; i < size; i++) {
    line=mLines.get(i);
    if (line.updatePathPoints()) {
      lastLine=mLines.get(i - 1);
      line.updatePathWithStartPoints(lastLine.mPoints[3],lastLine.mPoints[2]);
    }
 else {
      mLines.remove(i);
      size=mLines.size();
    }
  }
}
Program: 157223
Project: 157223
Buggy source:
private int[] getKeyCodesFromPhysicalSequence(String keyCodesArray){
  String[] splitted=keyCodesArray.split("String_Node_Str");
  int[] keyCodes=new int[splitted.length];
  for (int i=0; i < keyCodes.length; i++) {
    try {
      keyCodes[i]=Integer.parseInt(splitted[i]);
    }
 catch (    final NumberFormatException nfe) {
      final String v=splitted[i];
      try {
        keyCodes[i]=android.view.KeyEvent.class.getField(v).getInt(null);
      }
 catch (      final Exception ex) {
        throw new RuntimeException(ex);
      }
    }
  }
  return keyCodes;
}

Fixed version (ground truth):
@NonNull private int[] getKeyCodesFromPhysicalSequence(String keyCodesArray){
  String[] splitted=keyCodesArray.split("String_Node_Str");
  int[] keyCodes=new int[splitted.length];
  for (int i=0; i < keyCodes.length; i++) {
    try {
      keyCodes[i]=Integer.parseInt(splitted[i]);
    }
 catch (    final NumberFormatException nfe) {
      final String v=splitted[i];
      try {
        keyCodes[i]=android.view.KeyEvent.class.getField(v).getInt(null);
      }
 catch (      final Exception ex) {
        throw new RuntimeException(ex);
      }
    }
  }
  return keyCodes;
}
Program: 157224
Project: 157224
Buggy source:
@Override public char[] getSentenceSeparators(){
  return mSentenceSeparators;
}

Fixed version (ground truth):
@Override @SuppressFBWarnings("String_Node_Str") public char[] getSentenceSeparators(){
  return mSentenceSeparators;
}
Program: 157226
Project: 157226
Buggy source:
/** 
 * Checks if the given word occurs in the dictionary
 * @param word the word to search for. The search should be case-insensitive.
 * @return true if the word exists, false otherwise
 */
abstract public boolean isValidWord(CharSequence word);

Fixed version (ground truth):
/** 
 * Checks if the given word occurs in the dictionary
 * @param word the word to search for. The search should be case-insensitive.
 * @return true if the word exists, false otherwise
 */
public abstract boolean isValidWord(CharSequence word);
Program: 157227
Project: 157227
Buggy source:
/** 
 * Compares the contents of the character array with the typed word and returns true if they are the same.
 * @param word      the array of characters that make up the word
 * @param length    the number of valid characters in the character array
 * @param typedWord the word to compare with
 * @return true if they are the same, false otherwise.
 */
static protected boolean same(final char[] word,final int length,final CharSequence typedWord){
  if (typedWord.length() != length) {
    return false;
  }
  for (int i=0; i < length; i++) {
    if (word[i] != typedWord.charAt(i)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Compares the contents of the character array with the typed word and returns true if they are the same.
 * @param word      the array of characters that make up the word
 * @param length    the number of valid characters in the character array
 * @param typedWord the word to compare with
 * @return true if they are the same, false otherwise.
 */
protected static boolean same(final char[] word,final int length,final CharSequence typedWord){
  if (typedWord.length() != length) {
    return false;
  }
  for (int i=0; i < length; i++) {
    if (word[i] != typedWord.charAt(i)) {
      return false;
    }
  }
  return true;
}
Program: 157228
Project: 157228
Buggy source:
public boolean performOperationWithMemRetry(String TAG,MemRelatedOperation operation,boolean failWithException){
  reset();
  boolean retry=true;
  while (retry) {
    try {
      operation.operation();
      return true;
    }
 catch (    OutOfMemoryError e) {
      Log.w(TAG,"String_Node_Str");
      retry=tryGCOrWait(TAG,e);
      if (!retry && failWithException)       throw e;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean performOperationWithMemRetry(final String tag,MemRelatedOperation operation,final boolean failWithException){
  reset();
  boolean retry=true;
  while (retry) {
    try {
      operation.operation();
      return true;
    }
 catch (    OutOfMemoryError e) {
      Log.w(tag,"String_Node_Str");
      retry=tryGCOrWait(tag,e);
      if (!retry && failWithException)       throw e;
    }
  }
  return false;
}
Program: 157229
Project: 157229
Buggy source:
private void reset(){
  mGCTryCount=0;
}

Fixed version (ground truth):
private void reset(){
  mGarbageCollectingTryCount=0;
}
Program: 157230
Project: 157230
Buggy source:
private boolean tryGCOrWait(String metaData,Throwable t){
  if (mGCTryCount % GC_TRY_COUNT == 0) {
    System.gc();
  }
  if (mGCTryCount > GC_TRY_LOOP_MAX) {
    return false;
  }
 else {
    mGCTryCount++;
    try {
      Thread.sleep(GC_INTERVAL);
      return true;
    }
 catch (    InterruptedException e) {
      Log.e(metaData,"String_Node_Str");
      return false;
    }
  }
}

Fixed version (ground truth):
private boolean tryGCOrWait(String metaData,Throwable t){
  if (mGarbageCollectingTryCount % GC_TRY_COUNT == 0) {
    System.gc();
  }
  if (mGarbageCollectingTryCount > GC_TRY_LOOP_MAX) {
    return false;
  }
 else {
    mGarbageCollectingTryCount++;
    try {
      Thread.sleep(GC_INTERVAL);
      return true;
    }
 catch (    InterruptedException e) {
      Log.e(metaData,"String_Node_Str");
      return false;
    }
  }
}
Program: 157231
Project: 157231
Buggy source:
public static float convertDipToPx(Context context,float fDip){
  float fPx=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,fDip,context.getResources().getDisplayMetrics());
  return fPx;
}

Fixed version (ground truth):
public static float convertDipToPx(Context context,float dp){
  float fPx=TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,dp,context.getResources().getDisplayMetrics());
  return fPx;
}
Program: 157232
Project: 157232
Buggy source:
public boolean updatePathPoints(){
  float distance=mPathWidth / 2;
  float dx=0, dy=0;
  PointF leftTop, leftBottom, rightBottom, rightTop;
  PointF direction=new PointF(mEndX - mStartX,mEndY - mStartY);
  direction.x=direction.x / direction.length();
  direction.y=direction.y / direction.length();
  PointF directionV=new PointF(direction.y,-direction.x);
  dx=distance * directionV.x;
  dy=distance * directionV.y;
  leftTop=new PointF(mEndX + dx,mEndY + dy);
  rightTop=new PointF(mEndX - dx,mEndY - dy);
  leftBottom=new PointF(mStartX + dx,mStartY + dy);
  rightBottom=new PointF(mStartX - dx,mStartY - dy);
  mPoints[0]=leftTop;
  mPoints[1]=rightTop;
  mPoints[2]=rightBottom;
  mPoints[3]=leftBottom;
  return true;
}

Fixed version (ground truth):
public boolean updatePathPoints(){
  float distance=mPathWidth / 2;
  PointF direction=new PointF(mEndX - mStartX,mEndY - mStartY);
  direction.x=direction.x / direction.length();
  direction.y=direction.y / direction.length();
  PointF directionV=new PointF(direction.y,-direction.x);
  float dx=distance * directionV.x;
  float dy=distance * directionV.y;
  PointF leftTop=new PointF(mEndX + dx,mEndY + dy);
  PointF rightTop=new PointF(mEndX - dx,mEndY - dy);
  PointF leftBottom=new PointF(mStartX + dx,mStartY + dy);
  PointF rightBottom=new PointF(mStartX - dx,mStartY - dy);
  mPoints[0]=leftTop;
  mPoints[1]=rightTop;
  mPoints[2]=rightBottom;
  mPoints[3]=leftBottom;
  return true;
}
Program: 157233
Project: 157233
Buggy source:
public ArrayList<String> getCandidates(){
  int[] corners=getPathCorners(mXs,mYs,CURVATURE_SIZE);
  int numSuggestions=5;
  ArrayList<String> candidates=new ArrayList<>();
  ArrayList<Double> weights=new ArrayList<>();
  int startChar='-';
  for (  Keyboard.Key k : mKeys) {
    if (Math.abs(k.x + k.width / 2 - corners[0]) < k.width / 2 && Math.abs(k.y + k.height / 2 - corners[1]) < k.height / 2) {
      startChar=k.getPrimaryCode();
      break;
    }
  }
  for (int i=0; i < mWords.size(); i++) {
    int code=mWords.get(i).charAt(0);
    if (code < startChar)     continue;
    if (code > startChar)     break;
    double weight=getWordDistance(corners,mWordsCorners.get(i));
    if (weights.size() == numSuggestions && weight >= weights.get(weights.size() - 1))     continue;
    int j=0;
    while (j < weights.size() && weights.get(j) <= weight)     j++;
    weights.add(j,weight);
    candidates.add(j,mWords.get(i));
    if (weights.size() > 5) {
      weights.remove(weights.size() - 1);
      candidates.remove(candidates.size() - 1);
    }
  }
  return candidates;
}

Fixed version (ground truth):
public ArrayList<String> getCandidates(){
  ArrayList<String> candidates=new ArrayList<>();
  if (mWordsCorners.size() != mWords.size()) {
    return candidates;
  }
  int[] corners=getPathCorners(mXs,mYs,CURVATURE_SIZE);
  int numSuggestions=5;
  ArrayList<Double> weights=new ArrayList<>();
  int startChar='-';
  for (  Keyboard.Key k : mKeys) {
    if (Math.abs(k.x + k.width / 2 - corners[0]) < k.width / 2 && Math.abs(k.y + k.height / 2 - corners[1]) < k.height / 2) {
      startChar=k.getPrimaryCode();
      break;
    }
  }
  for (int i=0; i < mWords.size(); i++) {
    int code=mWords.get(i).charAt(0);
    if (code < startChar)     continue;
    if (code > startChar)     break;
    double weight=getWordDistance(corners,mWordsCorners.get(i));
    if (weights.size() == numSuggestions && weight >= weights.get(weights.size() - 1))     continue;
    int j=0;
    while (j < weights.size() && weights.get(j) <= weight)     j++;
    weights.add(j,weight);
    candidates.add(j,mWords.get(i));
    if (weights.size() > 5) {
      weights.remove(weights.size() - 1);
      candidates.remove(candidates.size() - 1);
    }
  }
  return candidates;
}
Program: 157234
Project: 157234
Buggy source:
/** 
 * Did we come close enough to a normal (alphabet) character for this to be considered the start of a gesture?
 */
public boolean isValidStartTouch(int x,int y){
  if (mWordsCornersState == LoadingState.LOADING)   return false;
  for (  Keyboard.Key key : mKeys) {
    final float closestX=(x < key.x) ? key.x : (x > (key.x + key.width)) ? (key.x + key.width) : x;
    final float closestY=(y < key.y) ? key.y : (y > (key.y + key.height)) ? (key.y + key.height) : y;
    final float xDist=Math.abs(closestX - x);
    final float yDist=Math.abs(closestY - y);
    if (xDist <= key.width / 3f && yDist <= key.height / 3f && key.label != null && key.label.length() == 1 && Character.isLetter(key.label.charAt(0))) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Did we come close enough to a normal (alphabet) character for this to be considered the start of a gesture?
 */
public boolean isValidStartTouch(int x,int y){
  for (  Keyboard.Key key : mKeys) {
    final float closestX=(x < key.x) ? key.x : (x > (key.x + key.width)) ? (key.x + key.width) : x;
    final float closestY=(y < key.y) ? key.y : (y > (key.y + key.height)) ? (key.y + key.height) : y;
    final float xDist=Math.abs(closestX - x);
    final float yDist=Math.abs(closestY - y);
    if (xDist <= key.width / 3f && yDist <= key.height / 3f && key.label != null && key.label.length() == 1 && Character.isLetter(key.label.charAt(0))) {
      return true;
    }
  }
  return false;
}
Program: 157235
Project: 157235
Buggy source:
@Override public void onGestureTypingInputDone(){
  if (!mGestureTypingEnabled)   return;
  InputConnection ic=getCurrentInputConnection();
  if (mGestureTypingEnabled && ic != null) {
    ArrayList<String> gestureTypingPossibilities=mGestureTypingDetector.getCandidates();
    final boolean isShifted=mShiftKeyState.isActive();
    final boolean isCapsLocked=mShiftKeyState.isLocked();
    if (gestureTypingPossibilities.size() > 0) {
      ic.beginBatchEdit();
      final boolean alsoAddSpace=TextEntryState.getState() == TextEntryState.State.PERFORMED_GESTURE;
      abortCorrectionAndResetPredictionState(false);
      if (alsoAddSpace) {
        ic.commitText("String_Node_Str",1);
      }
      CharSequence word=gestureTypingPossibilities.get(0);
      mWord.reset();
      mWord.setAutoCapitalized(isShifted || isCapsLocked);
      mWord.simulateTypedWord(word);
      commitWordToInput(mWord.getTypedWord(),false);
      TextEntryState.performedGesture();
      if (gestureTypingPossibilities.size() > 1) {
        setCandidatesViewShown(true);
        setSuggestions(gestureTypingPossibilities,false,true,true);
      }
 else {
        setSuggestions(Collections.<CharSequence>emptyList(),false,false,false);
      }
      ic.endBatchEdit();
    }
    mGestureTypingDetector.clearGesture();
  }
}

Fixed version (ground truth):
@Override public void onGestureTypingInputDone(){
  if (!getGestureTypeingEnabled())   return;
  InputConnection ic=getCurrentInputConnection();
  if (getGestureTypeingEnabled() && ic != null) {
    ArrayList<String> gestureTypingPossibilities=mGestureTypingDetector.getCandidates();
    final boolean isShifted=mShiftKeyState.isActive();
    final boolean isCapsLocked=mShiftKeyState.isLocked();
    if (gestureTypingPossibilities.size() > 0) {
      ic.beginBatchEdit();
      final boolean alsoAddSpace=TextEntryState.getState() == TextEntryState.State.PERFORMED_GESTURE;
      abortCorrectionAndResetPredictionState(false);
      if (alsoAddSpace) {
        ic.commitText("String_Node_Str",1);
      }
      CharSequence word=gestureTypingPossibilities.get(0);
      mWord.reset();
      mWord.setAutoCapitalized(isShifted || isCapsLocked);
      mWord.simulateTypedWord(word);
      commitWordToInput(mWord.getTypedWord(),false);
      TextEntryState.performedGesture();
      if (gestureTypingPossibilities.size() > 1) {
        setCandidatesViewShown(true);
        setSuggestions(gestureTypingPossibilities,false,true,true);
      }
 else {
        setSuggestions(Collections.<CharSequence>emptyList(),false,false,false);
      }
      ic.endBatchEdit();
    }
    mGestureTypingDetector.clearGesture();
  }
}
Program: 157236
Project: 157236
Buggy source:
@Override public void onGestureTypingInput(int x,int y,long eventTime){
  if (!mGestureTypingEnabled)   return;
  mGestureTypingDetector.addPoint(x,y,eventTime);
}

Fixed version (ground truth):
@Override public void onGestureTypingInput(int x,int y,long eventTime){
  if (!getGestureTypeingEnabled())   return;
  mGestureTypingDetector.addPoint(x,y,eventTime);
}
Program: 157237
Project: 157237
Buggy source:
@Override public boolean isValidGestureTypingStart(int x,int y){
  if (!mGestureTypingEnabled)   return false;
  mGestureTypingDetector.setKeys(getCurrentAlphabetKeyboard().getKeys(),this,getCurrentAlphabetKeyboard().getMinWidth(),getCurrentAlphabetKeyboard().getHeight());
  return mGestureTypingDetector.isValidStartTouch(x,y);
}

Fixed version (ground truth):
@Override public boolean isValidGestureTypingStart(int x,int y){
  if (!getGestureTypeingEnabled())   return false;
  mGestureTypingDetector.setKeys(getCurrentAlphabetKeyboard().getKeys(),this,getCurrentAlphabetKeyboard().getMinWidth(),getCurrentAlphabetKeyboard().getHeight());
  return mGestureTypingDetector.isValidStartTouch(x,y);
}
Program: 157238
Project: 157238
Buggy source:
@Override public void onGestureTypingInputStart(int x,int y,long eventTime){
  if (!mGestureTypingEnabled)   return;
  mGestureTypingDetector.clearGesture();
  mGestureTypingDetector.addPoint(x,y,eventTime);
}

Fixed version (ground truth):
@Override public void onGestureTypingInputStart(int x,int y,long eventTime){
  if (!getGestureTypeingEnabled())   return;
  mGestureTypingDetector.clearGesture();
  mGestureTypingDetector.addPoint(x,y,eventTime);
}
Program: 157239
Project: 157239
Buggy source:
@RequiresApi(Build.VERSION_CODES.HONEYCOMB) private void storeKeyboardByAppMapping(){
  SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(mContext);
  Set<String> mapping=new HashSet<>(mAlphabetKeyboardIndexByPackageId.size());
  for (  Map.Entry<String,CharSequence> aMapping : mAlphabetKeyboardIndexByPackageId.entrySet()) {
    mapping.add(String.format(Locale.US,"String_Node_Str",aMapping.getKey(),aMapping.getValue()));
  }
  final SharedPreferences.Editor editor=sharedPreferences.edit();
  editor.putStringSet(mContext.getString(R.string.settings_key_persistent_layout_per_package_id_mapping),mapping);
  editor.commit();
}

Fixed version (ground truth):
@RequiresApi(Build.VERSION_CODES.HONEYCOMB) private void storeKeyboardByAppMapping(){
  SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(mContext);
  Set<String> mapping=new HashSet<>(mAlphabetKeyboardIndexByPackageId.size());
  for (  Map.Entry<String,CharSequence> aMapping : mAlphabetKeyboardIndexByPackageId.entrySet()) {
    mapping.add(String.format(Locale.US,"String_Node_Str",aMapping.getKey(),aMapping.getValue()));
  }
  final SharedPreferences.Editor editor=sharedPreferences.edit();
  editor.putStringSet(mContext.getString(R.string.settings_key_persistent_layout_per_package_id_mapping),mapping);
  SharedPreferencesCompat.EditorCompat.getInstance().apply(editor);
}
Program: 157240
Project: 157240
Buggy source:
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  Context appContext=getActivity().getApplicationContext();
  mRecyclerView=(RecyclerView)view.findViewById(R.id.recycler_view);
  mRecyclerView.setHasFixedSize(false);
  mRecyclerView.setLayoutManager(createLayoutManager(appContext));
  mRecyclerView.setAdapter(new DemoKeyboardAdapter());
  mRecyclerViewItemTouchHelper.attachToRecyclerView(mRecyclerView);
  if (mIsSingleSelection) {
    mSelectedKeyboardView=(DemoAnyKeyboardView)view.findViewById(R.id.selected_demo_keyboard_view);
    if (mSimulateTyping) {
      mSelectedKeyboardView.setSimulatedTypingText("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void onViewCreated(View view,Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  Context appContext=getActivity().getApplicationContext();
  mRecyclerView=view.findViewById(R.id.recycler_view);
  mRecyclerView.setHasFixedSize(false);
  mRecyclerView.setLayoutManager(createLayoutManager(appContext));
  mRecyclerView.setAdapter(new DemoKeyboardAdapter());
  mRecyclerViewItemTouchHelper.attachToRecyclerView(mRecyclerView);
  if (mIsSingleSelection) {
    mSelectedKeyboardView=view.findViewById(R.id.selected_demo_keyboard_view);
    if (mSimulateTyping) {
      mSelectedKeyboardView.setSimulatedTypingText("String_Node_Str");
    }
  }
}
Program: 157241
Project: 157241
Buggy source:
@Override public void onCreateOptionsMenu(Menu menu,MenuInflater inflater){
  super.onCreateOptionsMenu(menu,inflater);
  if (hasOptionsMenu()) {
    inflater.inflate(R.menu.add_on_selector_menu,menu);
    menu.findItem(R.id.add_on_market_search_menu_option).setVisible(getMarketSearchTitle() != 0);
    menu.findItem(R.id.tweaks_menu_option).setVisible(mHasTweaksOption);
  }
}

Fixed version (ground truth):
@Override public void onCreateOptionsMenu(Menu menu,MenuInflater inflater){
  super.onCreateOptionsMenu(menu,inflater);
  inflater.inflate(R.menu.add_on_selector_menu,menu);
  menu.findItem(R.id.add_on_market_search_menu_option).setVisible(getMarketSearchTitle() != 0);
  menu.findItem(R.id.tweaks_menu_option).setVisible(mHasTweaksOption);
}
Program: 157242
Project: 157242
Buggy source:
@SuppressWarnings("String_Node_Str") private void saveCorners(Context context){
  try {
    final File outFile=new File(context.getFilesDir(),"String_Node_Str");
    outFile.createNewFile();
    DataOutputStream writer=new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(outFile))));
    for (    int[] corners : mWordsCorners) {
      writer.writeShort(corners.length);
      for (int i=0; i < corners.length / 2; i++) {
        writer.writeShort((short)(corners[i * 2] / (float)width * WORDS_SIZE));
        writer.writeShort((short)(corners[i * 2 + 1] / (float)height * WORDS_SIZE));
      }
    }
    writer.flush();
    writer.close();
  }
 catch (  IOException e) {
    Log.e(TAG,"String_Node_Str",e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void saveCorners(Context context){
  try {
    final File outFile=new File(context.getFilesDir(),"String_Node_Str");
    outFile.createNewFile();
    DataOutputStream writer=new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(new FileOutputStream(outFile))));
    for (    int[] corners : mWordsCorners) {
      writer.writeShort(corners.length);
      for (int i=0; i < corners.length / 2; i++) {
        writer.writeShort((short)(corners[i * 2] * WORDS_SIZE / width));
        writer.writeShort((short)(corners[i * 2 + 1] * WORDS_SIZE / height));
      }
    }
    writer.flush();
    writer.close();
  }
 catch (  IOException e) {
    Log.e(TAG,"String_Node_Str",e);
    throw new RuntimeException(e);
  }
}